It seems the default Midnight Commander (mc) package (package version 4.8.20-2) doesn’t support UTF-8 correctly. This is problematic when Turris hosts a Samba server with lots of files that doesn’t display correctly.
The relevant settings in mc are set correctly:
- “Options” -> “Display bits” are set correctly to “UTF-8” with “Full 8 bits input” checkbox enabled,
- Panel “Encoding” is correctly set to “No translation”).
UTF-8 seems works fine on the command line. Steps to reproduce:
- run bash (ash doesn’t seem to support UTF-8 according to info on openwrt forum) and create a file with some non-ascii characters
root@turris:/tmp# bash
root@turris:/tmp# echo $0
bash
root@turris:/tmp# touch “Příliš žluťoučký kůň úpěl ďábelské ódy”
root@turris:/tmp# ls Př*
Příliš žluťoučký kůň úpěl ďábelské ódy
- run mc and check how the fle looks. It displays as “PM-E~YM-CM–liM-EM …”.
However, when selected, copied by “Alt + Enter” to mc’s command line as parameter to echo command, it’s displayed correctly when “Ctrl + o” is pressed to see the output.
The file also displays correctly in mc running in LXC contaner under Debian 9.
The only openwrt related topic I’ve found is https://forum.archive.openwrt.org/viewtopic.php?id=68106 (Midnight Commander doesn’t display UTF-8 correctly) that suggests recompiling mc from the scratch, but for a commercial product, the package should really support UTF-8 out of the box.