'Oracle sqlplus Chinese characters garbled
- I run a simple query with oracle database 11g on CentOS, but I got wrong CHARACTER SET.
SQL> select col_name from table_name where rownum <= 1;
col_name
--------------------------------------------------------------------------------
¸ñ귎Ϊʯҩ¼¯΅mRNAт¹ےࠃ萮Ŀ802³µ¼乄լ¾»»¯ůͨ¹¤³̡£
- I get database CHARACTER SET as follows
SQL> select userenv('language') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.ZHS16GBK
- Set CHARACTER SET to client
echo 'export NLS_LANG="AMERICAN_AMERICA.ZHS16GBK"'>>/etc/profile && source /etc/profile - rerun query SQL, but also got problem, How can I resolve it.
Solution 1:[1]
Check your terminal settings with locale charmap or echo $LANG and verify if it matches with ZHS16GBK.
It is not required to use the same character set as your database. Using NLS_LANG=AMERICAN_AMERICA.AL32UTF8 and UTF-8 in your terminal will also work. It is important that NLS_LANG matches your terminal character set.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Wernfried Domscheit |
