-
-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Labels
area: ttyInteraction with the terminal, screen librariesInteraction with the terminal, screen librariesprio: lowMinor problem or easily worked aroundMinor problem or easily worked around
Milestone
Description
Important
This issue was migrated from Trac:
| Origin | https://midnight-commander.org/ticket/2282 |
|---|---|
| Reporter | zyxmon (zyxmon@….com) |
I have arm based nas (synology ds110j), that does not support locales but stores files in uft-8.
The sample program
#include <langinfo.h>
#include <locale.h>
#include <stdio.h>
int
main (int argc, char *argv[])
{
setlocale (LC_ALL, "");
printf ("%s\n", nl_langinfo (CODESET));
return 0;
}
always returns ANSI_X3.4-1968
To make mc correctly work with utf-8 on this system I've made changes in 2 files:
1) In lib/strutil/strutil.c
I've changed
return (nl_langinfo (CODESET));
to
return "UTF8";
2) In lib\tty\tty-slang.c
I've changed
SLutf8_enable (-1);
to
SLutf8_enable (1);
These changes force utf-8 support in mc on my system.
I think these changes can be made an option in future releases in mc for such systems.
PS Many thanks to il.smind, who helped my to find this solution.
Note
Original attachments:
- 100-strutil.patch (raw) by
zyxmon(zyxmon@….com) onMar 29, 2011 at 9:28 UTC - 200-tty.patch (raw) by
zyxmon(zyxmon@….com) onMar 29, 2011 at 9:28 UTC
Metadata
Metadata
Assignees
Labels
area: ttyInteraction with the terminal, screen librariesInteraction with the terminal, screen librariesprio: lowMinor problem or easily worked aroundMinor problem or easily worked around