Skip to Main Content

Breadcrumb

Question and Answer

Sergiusz Wolicki

Thanks for the question, Diego.

Asked: August 10, 2017 - 9:59 am UTC

Last updated: August 15, 2017 - 10:48 pm UTC

Version: 11

Viewed 10K+ times! This question is

You Asked

I have a test db from the client that allows you to see Chinese characters if you copy and paste them, but if I run a insert query I see "¿¿¿¿¿".
I have this configuration:
NLS_CHARACTERSET WE8MSWIN1252
NLS_NCHAR_CHARACTERSET AL16UTF16

The old production DB have different configuration NLS_CHARACTERSET to ZHS16GBK and I could save chinese character, can I modify the NLS_CHARACTSET?
Best Regards
Diego Abramo

and we said...

As you correctly suspect the problem with Chinese characters is caused by the database character set (NLS_CHARACTERSET) WE8MSWIN1252. "WE" in the name stands for "Western European". East Asian Chinese characters are obviously not Western European. On the other hand, "ZHS" in ZHS16GBK stands for ZHōngwén (Chinese) Simplified and covers the Simplified Chinese script used in mainland China.

Unfortunately, you cannot change the character set of an existing database from WE8MSWIN1252 to ZHS16GBK. You can repair a character set with the csrepair.plb script, which is part of the Database Migration Assistant for Unicode (DMU), but only if the current and the desired character sets are either both single-byte or both multibyte. WE8MSWIN1252 is single-byte, ZHS16GBK is multibyte, hence the script will not run.

Your options depend on what you actually want to achieve. If the goal is to make the WE8MSWIN1252 database support Chinese, then the Oracle recommended approach is to migrate to AL32UTF8 (Unicode UTF-8). This character set will support Chinese, European languages, and almost all other contemporary languages, though Chinese text will need 50% more bytes for storage. You can do the migration to AL32UTF8 with the DMU utility (see: oracle.com/dmu). Alternatively, you can create a new database in ZHS16GBK and migrate the content of the current WE8MSWIN1252 with Data Pump. In this case, only ASCII characters are guaranteed to survive the migration. Many Western European characters and all Chinese characters stored using pass-through configuration (see: [1] http://docs.oracle.com/cd/E71288_01/DUMAG/ch1_overview.htm#GUID-CD14CBAA-CE10-4D8C-86D5-D1CC3B1F2AE8 ) will be lost.


Is this answer out of date? If it is, please let us know via a Comment

More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database