support for Cyrillic in mc

1,087 views
Skip to first unread message

Andrey Suprun

unread,
Dec 6, 2014, 12:30:09 PM12/6/14
to al...@googlegroups.com
Please tell me how to add support for Cyrillic names of files and folders in Midnight Commander?
Hardware: D-Link DNS-323 Rev B1
Alt-F: 0.1RC4 with kernel 3.10.32
Midnight Commander: 4.8.1.6

Andrey Suprun

unread,
Dec 6, 2014, 4:39:14 PM12/6/14
to
I've forgot to mention that I have tried all codepages in Options->Display bits. Also, Cyrillic files and folders that I need are on the external NTFS formatted USB hard drive.

João Cardoso

unread,
Dec 8, 2014, 10:07:54 AM12/8/14
to al...@googlegroups.com


On Saturday, December 6, 2014 9:39:14 PM UTC, Andrey Suprun wrote:
I've forgot to mention that I have tried all codepages in Options->Display bits. Also, Cyrillic files and folders that I need are on the external NTFS formatted USB hard drive.

I have no idea, better ask on a 'mc' related forum. But be warned that internationalization support is very limited in Alt-F.

Does file names appear correctly when using the 'ls' command?
Do you need to use any special codepage mount options in order to see file names correctly when using the command line?
Alt-F should use UTF8 encoding by default.

Andrey Suprun

unread,
Dec 8, 2014, 3:20:23 PM12/8/14
to al...@googlegroups.com
Yes, file names appear correctly when using 'ls' command.
No, I don't use any special mount options. Just plug in USB hard drive and it works.
Maybe the latest version of Midnight Commander will work for me? How to install it?

Andrey Suprun

unread,
Dec 7, 2015, 5:34:44 AM12/7/15
to al...@googlegroups.com
It seems that I found the cause. The Midnight Commander doesn't save "display_codepage" parameter even when I change it directly in file "/root/.config/mc/ini" so it's always "display_codepage=ASCII". How to make it save "display_codepage=UTF-8"?

Andrey Suprun

unread,
Dec 7, 2015, 7:54:59 AM12/7/15
to Alt-F
I think I've found a solution. The Midnight Commander should be compiled with "--enable-charset". How to do this?

Joao Cardoso

unread,
Dec 9, 2015, 8:28:16 PM12/9/15
to al...@googlegroups.com


On Monday, December 7, 2015 at 12:54:59 PM UTC, Andrey Suprun wrote:
I think I've found a solution. The Midnight Commander should be compiled with "--enable-charset". How to do this?

That is already the default in mc, so it's not your issue.

Be warned that internationalization is not a concern to me. All packages are compiled with --disable-nls (do not use Native Language Support).
This has nothing to do  (shouldn't have) with file names or contents, but the terminal characteristics might limit the way how file names or contents are displayed.
"nls" is only related to make programs messages, menus, etc, configurable for a specific language (generally through a "locale" environment variable, not used by *any* Alt-F package).

Are the NTFS Cyrillic file names and contents correctly displayed on a simple "ls" or "find" command? How do they appear in the Setup->Folders Browse?
On some old filesystems of mine, file names and contents use iso-8859-1, and they are wrongly displayed. The Alt-F included 'iconv' program (convert text from one character encoding to another) can convert file names and contents to other charset; use 'iconv -l' to see the available charsets. BTW, mc is using libiconv, the same library that the iconv program uses.

I'm afraid that I can't be of many help, as I often even write my first name as Joao instead of the correct form João, just to keep it simple for many people.

Andrey Suprun

unread,
Dec 10, 2015, 5:14:10 AM12/10/15
to Alt-F
Are the NTFS Cyrillic file names and contents correctly displayed on a simple "ls" or "find" command? How do they appear in the Setup->Folders Browse?

Yes, the content is correctly displayed on a "ls" command. Also, the Cyrillic symbols aren't correctly displayed not only on mounted NTFS volume, but on internal volumes too. You can try it by yourself. Just unzip attached file and look at the symbols in the name of uzipped file. It should be: "Тест отображения кириллицы в названии файла".
test.zip

Rolf Pedersen

unread,
Dec 10, 2015, 8:53:56 AM12/10/15
to al...@googlegroups.com


On 12/10/2015 02:14 AM, Andrey Suprun wrote:
Are the NTFS Cyrillic file names and contents correctly displayed on a simple "ls" or "find" command? How do they appear in the Setup->Folders Browse?

Yes, the content is correctly displayed on a "ls" command. Also, the Cyrillic symbols aren't correctly displayed not only on mounted NTFS volume, but on internal volumes too. You can try it by yourself. Just unzip attached file and look at the symbols in the name of uzipped file. It should be: "Тест отображения кириллицы в названии файла".


This shows correctly in Ark archive software on Mageia Linux, it seems to me.  Also by ls in konsole, although bash-completion doesn't work on these characters for me, and in the file browser, konqueror.  Maybe someone smarter than I can make use of it.
Rolf






João Cardoso

unread,
Dec 14, 2015, 1:23:41 PM12/14/15
to al...@googlegroups.com


On Thursday, 10 December 2015 10:14:10 UTC, Andrey Suprun wrote:
Are the NTFS Cyrillic file names and contents correctly displayed on a simple "ls" or "find" command? How do they appear in the Setup->Folders Browse?

Yes, the content is correctly displayed on a "ls" command. Also, the Cyrillic symbols aren't correctly displayed not only on mounted NTFS volume, but on internal volumes too. You can try it by yourself. Just unzip attached file and look at the symbols in the name of uzipped file. It should be: "Тест отображения кириллицы в названии файла".

Yes, I can confirm that, 'mc' isn't able to correctly display the file name, although 'ls' can:

[root@dns-320l]# ls
josé
joão
Тест отображения кириллицы в названии файла

but in 'mc' I get '???' for the chars, no matter if setting the encoding (Alt-e c) and the display bits (Options->Display Bits) for UTF-8.
I can create files with special chars under 'mc', but not display them (the created files under mc will appear OK when using ls).



The fact that a plain 'ls' shows the correct filenames means that filename is correctly encoded in the filesystem and that the font being used in the terminal is also OK. The Setup->Folders webUI also shows that correctly.

So the issue is somehow in 'mc'. If you search the net for mc and UTF-8 filenames you will find a lot of occurences. Most of them refer to setting the terminal (which is OK, as the 'ls' output proves) or the language, which is meaningless, as Alt-F has no locate (LANG).

BTW, you can use 'export TERM=xterm' in the box to have an improved mc graphical output and being able to use the mouse buttons -- just double click on buttons.

Can't help more, sorry. If you come up with a solution please report back.
And the key words: 'ls' displays file names OK, Encoding and Display Bits in 'mc' set to UTF-8, 'mc' compiled with --enable-charset and ncurses library, TERM set to xterm, LANG unset (no locate support)


Andrey Suprun

unread,
Dec 15, 2015, 4:42:45 AM12/15/15
to Alt-F
João Cardoso, thank you for your investigation. I have searched Google for several hours but no luck. By the way, I used mc on Ubuntu, Debian, FreeBSD and in all cases it was showing Cyrillic letters correct.

Andrey Suprun

unread,
Sep 10, 2016, 7:34:08 AM9/10/16
to Alt-F
After update to Alt-F 0.1RC5 with kernel 3.18.28 the situation didn't change.

Prototype

unread,
Nov 14, 2016, 1:13:03 PM11/14/16
to Alt-F
mc 4.8.18-1 forn Entware works well with cyrilic filenames on Alt-F

João Cardoso

unread,
Nov 14, 2016, 1:35:25 PM11/14/16
to Alt-F


On Monday, 14 November 2016 18:13:03 UTC, Prototype wrote:
mc 4.8.18-1 forn Entware works well with cyrilic filenames on Alt-F

Somebody should see (at some mc forum or site) if this issue has anything to do with 'locales', as Entware supports it and Alt-F don't. All Alt-F packages are configured without "nls" (native language support), --disable-nls.
BTW, have you added/installed some "locale" to Entware or defined some LANG, or did it display those cyrilic characters OK out of the install?

Prototype

unread,
Nov 14, 2016, 2:02:44 PM11/14/16
to al...@googlegroups.com

BTW, have you added/installed some "locale" to Entware or defined some LANG, or did it display those cyrilic characters OK out of the install?

No I did not added "locale" nor LANG. But I seen something about locales in output during installation.  Looks like it installs automatically
entware_install.sh
................
if [ ! -f /opt/usr/lib/locale/locale-archive ]
then
        wget http://pkg.entware.net/binaries/other/locale-archive.2.23 -O /opt/usr/lib/locale/locale-archive
fi
...........
 

Andrey Suprun

unread,
Nov 15, 2016, 8:45:00 AM11/15/16
to Alt-F
I have successfully installed mc from Entware-ng repository, but it displays Cyrillic the same way as mc from Alt-F. What should I do to make it display Cyrillic correctly?

By the way, when I set "UTF-8" in "mc->Options->Display bits->Input/display codepage" and restart mc, it reverts back to "7-bit ASCII". Maybe this is the cause?

Prototype

unread,
Nov 15, 2016, 9:57:28 AM11/15/16
to al...@googlegroups.com
Did you install Entware-ng it self or just mc from  http://pkg.entware.net/binaries/armv5/mc_4.8.18-1_armv5soft.ipk ?
If just mc there will be no Cyrillic. If Ill find how to install just mc without entware and have Cyrillic, Ill post here  

Andrey Suprun

unread,
Nov 15, 2016, 11:22:21 AM11/15/16
to Alt-F
I have installed Entware-ng itself with this script: http://pkg.entware.net/binaries/armv5/installer/entware_install.sh
Then updated the list of packages with this command: /opt/bin/opkg update
Then I have deleted the mc from Alt-F via web-interface and installed mc from Entware-ng with this command: /opt/bin/opkg install mc
Any ideas why Cyrillic doesn't display correctly?

Prototype

unread,
Nov 15, 2016, 11:28:19 AM11/15/16
to Alt-F
export TERM=xterm
export LANG='ru_RU.UTF-8'
export LC_ALL='ru_RU.UTF-8'

Andrey Suprun

unread,
Nov 15, 2016, 11:34:05 AM11/15/16
to Alt-F
Now Cyrillic displays correctly.
Thank you!


On Tuesday, 15 November 2016 18:28:19 UTC+2, Prototype wrote:

João Cardoso

unread,
Nov 17, 2016, 2:00:58 PM11/17/16
to Alt-F
Entware has "locales" installed, and the following locales seems to be installed by default in /opt/usr/share/i18n/locales: de_DE en_GB en_US  it_IT fr_FR ru_RU

[root@dns-323]# opkg install coreutils-date
[root@dns-323]# LANG=ru_RU.UTF-8 /opt/bin/date
Чт ноя 17 18:55:46 UTC 2016

If that is the reason why 'mc' works file with cyrillic, Alt-F don't has locales.

Prototype

unread,
Nov 17, 2016, 3:25:18 PM11/17/16
to Alt-F
Is it possible to install locales to Alt-F? Having whole Entware becouse of mc hurts me. 
P.S. I know that Alt-F packages are compiled with --disable-nls, so recompiling mc will be the next step :)

четверг, 17 ноября 2016 г., 22:00:58 UTC+3 пользователь João Cardoso написал:

João Cardoso

unread,
Nov 18, 2016, 11:12:59 AM11/18/16
to Alt-F


On Thursday, 17 November 2016 20:25:18 UTC, Prototype wrote:
Is it possible to install locales to Alt-F? Having whole Entware becouse of mc hurts me. 
P.S. I know that Alt-F packages are compiled with --disable-nls, so recompiling mc will be the next step :)

Yes, and all the packages that support nls and currently have it disabled, and the C library support also, and the DNS-323 which simply has no flash memory space to store the locale files -- I often fight with it against a few KB missing. Yes, the 323 is old and slow (as I'm -- are you dropping me too ?:)

So, its a no go. Sorry.

PS-perhaps I could compile 'mc' with static builtin locales. Who wants Vietnamit, Chinese (which one of them?), Arabic,... name them. But all this is hypothetical, I'm not yet certain that locales is the real issue.

Prototype

unread,
Nov 18, 2016, 12:38:33 PM11/18/16
to al...@googlegroups.com
Yes, and all the packages that support nls and currently have it disabled, and the C library support also, and the DNS-323 which simply has no flash memory space to store the locale files -- I often fight with it against a few KB missing. Yes, the 323 is old and slow (as I'm -- are you dropping me too ?:)

Sorry for my bad English, I`m not asking to recompile a firmware, Minimalism for embedded devices must be as a rule even if it is some memory left :) My question was is it possible to install locales "on top" (Alt-F folder may be?) as it is done in Entware. In the routers there are also no space for locales in the flash.  
 
So, its a no go. Sorry.

PS-perhaps I could compile 'mc' with static builtin locales. Who wants Vietnamit, Chinese (which one of them?), Arabic,... name them. But all this is hypothetical, I'm not yet certain that locales is the real issue.
 
Not a good idea I think, size of mc_4.8.1.6-1_arm.ipk in your repository is 614.1 kB and mc_4.8.18-1_armv5soft.ipk in entware 631.kb so if it is possible to INSTALL locales it is better to compile mc just without --disable-nls key

P.S. or may be i'm wrong\not understand what locales are

Konstantin

unread,
Feb 5, 2017, 5:20:27 AM2/5/17
to Alt-F


пятница, 18 ноября 2016 г., 20:38:33 UTC+3 пользователь Prototype написал:
Yes, and all the packages that support nls and currently have it disabled, and the C library support also, and the DNS-323 which simply has no flash memory space to store the locale files -- I often fight with it against a few KB missing. Yes, the 323 is old and slow (as I'm -- are you dropping me too ?:)

Sorry for my bad English, I`m not asking to recompile a firmware, Minimalism for embedded devices must be as a rule even if it is some memory left :) My question was is it possible to install locales "on top" (Alt-F folder may be?) as it is done in Entware. In the routers there are also no space for locales in the flash.  

Hi! I compiled mc with UTF-8 patch and SLANG support for Alt-F 0.1RC5 firmware.

I am satisfied with the result. Cyrillic characters are displayed correctly.

Packages mc_4.8.1.6-2_arm.ipk and slang_2.2.4_arm.ipk now available at my local repository http://downloads.wild-bit.com/alt-f/pkgs

After connecting the repo packages are simply installed from the ALT-F web interface.

Sorry for my bad English :)








Prototype

unread,
Feb 5, 2017, 5:42:52 AM2/5/17
to Alt-F
Works as a charm, thank you!
Just one question , what is slang? What is it for?
mc from official repo nor from entware does not have slang dependency.

Konstantin

unread,
Feb 5, 2017, 7:10:39 AM2/5/17
to Alt-F


воскресенье, 5 февраля 2017 г., 13:42:52 UTC+3 пользователь Prototype написал:
Works as a charm, thank you!
Just one question , what is slang? What is it for?
mc from official repo nor from entware does not have slang dependency.

SLANG is multi-platform console display library. 

The library is needed for the correct display of characters in UTF-8 encoding.

João Cardoso

unread,
Feb 5, 2017, 1:56:34 PM2/5/17
to Alt-F


On Sunday, 5 February 2017 10:20:27 UTC, Konstantin wrote:


пятница, 18 ноября 2016 г., 20:38:33 UTC+3 пользователь Prototype написал:
Yes, and all the packages that support nls and currently have it disabled, and the C library support also, and the DNS-323 which simply has no flash memory space to store the locale files -- I often fight with it against a few KB missing. Yes, the 323 is old and slow (as I'm -- are you dropping me too ?:)

Sorry for my bad English, I`m not asking to recompile a firmware, Minimalism for embedded devices must be as a rule even if it is some memory left :) My question was is it possible to install locales "on top" (Alt-F folder may be?) as it is done in Entware. In the routers there are also no space for locales in the flash.  

Hi! I compiled mc with UTF-8 patch and SLANG support for Alt-F 0.1RC5 firmware.

I am satisfied with the result. Cyrillic characters are displayed correctly.

Packages mc_4.8.1.6-2_arm.ipk and slang_2.2.4_arm.ipk now available at my local repository http://downloads.wild-bit.com/alt-f/pkgs

Great! If you post the differences and patches I could integrate your changes. Something like  'svn diff package/mc package/slang'

Konrád Lőrinczi

unread,
Feb 5, 2017, 2:12:38 PM2/5/17
to al...@googlegroups.com
Seems to work fine with Hungarian language. 

Added URL to package library list, updated it.
Installed update for mc and installed slang package. 

Connected to DNS-320 using JuiceSSH from my Samsung Galaxy S4 i9505. 
Midnight Commander displays Hungarian characters correctly. 

I really waited for such update as charsets was not displayed correctly earlier. 

Great job! 
Thanks! 


Konrad Lorinczi 

--
You received this message because you are subscribed to the Google Groups "Alt-F" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alt-f+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/alt-f.
For more options, visit https://groups.google.com/d/optout.

João Cardoso

unread,
Feb 10, 2017, 2:55:41 PM2/10/17
to Alt-F
Konstantin has sent me the  differences and patches, thanks, and I updated the build process and updated packages. Only lightly tested, please test it (you have to remove Konstantin's mc and slang packages and feed first)

Prototype

unread,
Feb 11, 2017, 1:00:10 AM2/11/17
to Alt-F
Cyrilic works, thank you both.
Howeever installs slang as dependency. Not sure if this is good for non cyrillic users. 

пятница, 10 февраля 2017 г., 22:55:41 UTC+3 пользователь João Cardoso написал:

João Cardoso

unread,
Feb 11, 2017, 11:20:55 AM2/11/17
to Alt-F


On Saturday, 11 February 2017 06:00:10 UTC, Prototype wrote:
Cyrilic works, thank you both.


Thanks for reporting
 
Howeever installs slang as dependency.

Yes, that seems to be needed, it's the main configuration change for mc, it was configured --with-screen=ncurses and now it is --with-screen=slang

The full dependencies are:

mc 4.8.1.6-2
slang 2.2.4
pcre 8.20-1
readline 6.2
ncurses 5.9
libpng 1.2.38-4
libiconv 1.14
libglib2 2.20.4-1
gettext 0.16.1-1

Don't know if having pcre, png, etc support on slang is really usefull. Probably it's not needed for mc usage only, but if later (future) packages depends on slang and would take advantage on them, then its already done.

Not sure if this is good for non cyrillic users.

Not good, but also no harm 

Konrád Lőrinczi

unread,
Feb 11, 2017, 12:09:34 PM2/11/17
to al...@googlegroups.com
As I wrote, works fine for Hungarian language. 


Sergey Mazurov

unread,
May 9, 2017, 4:32:11 AM5/9/17
to al...@googlegroups.com
The easiest way I found to display Cyrillic characters for file names and still having overall English interface in mc is this:

export LC_ALL='en_US.UTF-8'

Just add this line to .bashrc

Or if you don't want global encoding changes create an alias in .bashrc

alias mc='LC_ALL="en_US.UTF-7" mc'



On Saturday, December 6, 2014 at 8:30:09 PM UTC+3, Andrey Suprun wrote:
Please tell me how to add support for Cyrillic names of files and folders in Midnight Commander?
Hardware: D-Link DNS-323 Rev B1
Alt-F: 0.1RC4 with kernel 3.10.32
Midnight Commander: 4.8.1.6
Reply all
Reply to author
Forward
0 new messages