This prints “LC_CTYPE” followed by the name of the charset. This is often quite useful information, and there does not seem to be another convenient way to get this information from the shell. It's also not apparent how to get this information from locale(1).
Hi Florian, The first example is: $ locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" ... And there the encoding listed matches the charset in use, do you think an additional example would still be warranted? http://man7.org/linux/man-pages/man1/locale.1.html Thanks.
(In reply to Marko Myllynen from comment #1) > Hi Florian, > > The first example is: > > $ locale > LANG=en_US.UTF-8 > LC_CTYPE="en_US.UTF-8" > ... > > And there the encoding listed matches the charset in use, do you think an > additional example would still be warranted? Yes, absolutely, because “locale -c charmap” works even if the charset is not part of the locale name: $ LC_ALL=zh_CN locale -c charmap LC_CTYPE GB2312 $ LC_ALL=lzh_TW locale -c charmap LC_CTYPE UTF-8 $ LC_ALL=zh_HK locale -c charmap LC_CTYPE BIG5-HKSCS I don't know of any other convenient way to obtain this information (short of writing a small C program which uses nl_langinfo(CODESET)).
Patch posted at http://thread.gmane.org/gmane.linux.man/10064. Thanks.
Closing this, as that patch was merged.