UNIX: SunOS Solaris displays Chinese garbled characters. The securecrt connection correctly displays Chinese characters.

Source: Internet
Author: User

This problem has gradually become clearer, and it was really difficult to get started. Now let's record it and forget it.

To sum up, you need to understand the encoding supported by the system, user environment variables Lang, and securecrt Character Set decoding options.

1. First check the Chinese characters supported by Solaris.

bash-3.00$ cd /usr/dt/app-defaults/bash-3.00$ lltotal 24drwxr-xr-x   9 root     bin          512 Aug  6  2009 .drwxr-xr-x  10 root     bin          512 Aug  6  2009 ..drwxr-xr-x   2 root     bin         1024 Aug  6  2009 Cdrwxr-xr-x   2 root     bin          512 Aug  6  2009 en_CA.UTF-8drwxr-xr-x   2 root     bin         1024 Aug  6  2009 en_US.UTF-8drwxr-xr-x   2 root     bin         1024 Aug  6  2009 zhdrwxr-xr-x   2 root     bin         1024 Aug  6  2009 zh.GBKdrwxr-xr-x   2 root     bin         1024 Aug  6  2009 zh.UTF-8lrwxrwxrwx   1 root     root           4 Aug  6  2009 zh_CN.EUC -> ./zhdrwxr-xr-x   2 root     bin         1024 Aug  6  2009 zh_CN.GB18030lrwxrwxrwx   1 root     root           8 Aug  6  2009 zh_CN.GBK -> ./zh.GBKlrwxrwxrwx   1 root     root          10 Aug  6  2009 zh_CN.UTF-8 -> ./zh.UTF-8bash-3.00$ 

2. Unify the user's environment variables with the securecrt settings.

CRT:

Close and reconnect the session after the configuration is complete ~~

Environment Variable

Only: Export lang = Zh. UTF-8

3. Test it.

In order to facilitate the test, explain the UTF-8, UTF-8 is a universal international encoding, the world's language with a set of character sets include, for both Chinese and English, a character occupies a byte, however, a single Chinese character requires three bytes, which makes it inconvenient. It should be sufficient for two Chinese characters. Understand the UTF-8, and then the options above you can try to encode with other characters by yourself.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.