On 5/2/07, DR. Lee - NS1 <[EMAIL PROTECTED]> wrote:
5) The LANG=en and if I change LANG=zh_CH.GB2312, it does not make any difference.
Characters that are displayed - at all - are displayed according to the settings of your terminal emulator. This is why the characters appear correct with more, vi and so forth. ls takes pains not to adversely affect terminals by sending data to them which might upset them (because among other reasons, this can cause security problems). It does this by asking the C library which characters are printable. How does the C library know? Well, here there is something of a problem; you have to tell the C library yourself by setting environment variables. Your terminator does not automatically set up your shell's environment. Your environment variable settings _must_ match the setup of your terminal emulator, otherwise you will get inconsistent behaviour. Inconsistency between the behaviour of "ls" and "vi" for example. To do this, set either LC_CTYPE (just to change chatacter type handling) or LC_ALL (to change everything). To verify that this has worked OK, use "locale". For example I live in Ireland and so I use: LANG=en_IE.UTF-8 LC_ALL=en_IE.UTF-8 You need to make sure that these environment varibles are exported by your shell, otherwise other programs (including locale) will not pick them up. You will also need to ensure that these variables are set correctly in either your login script or (as I do) in a system-wide configuration file. The system-wide configuration file used on my system here (Debian GNU/Linux) is /etc/environment. James. _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
