> [!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 #include #include 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](https://github.com/MidnightCommander/trac-archive/blob/master/attachments/ticket/2282/100-strutil.patch) ([raw](https://github.com/MidnightCommander/trac-archive/raw/master/attachments/ticket/2282/100-strutil.patch)) by `zyxmon` (zyxmon@….com) on `Mar 29, 2011 at 9:28 UTC` > * [200-tty.patch](https://github.com/MidnightCommander/trac-archive/blob/master/attachments/ticket/2282/200-tty.patch) ([raw](https://github.com/MidnightCommander/trac-archive/raw/master/attachments/ticket/2282/200-tty.patch)) by `zyxmon` (zyxmon@….com) on `Mar 29, 2011 at 9:28 UTC`
Important
This issue was migrated from Trac:
zyxmon(zyxmon@….com)I have arm based nas (synology ds110j), that does not support locales but stores files in uft-8.
The sample program
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
to
2) In lib\tty\tty-slang.c
I've changed
to
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:
zyxmon(zyxmon@….com) onMar 29, 2011 at 9:28 UTCzyxmon(zyxmon@….com) onMar 29, 2011 at 9:28 UTC