In the DB2 database, the problem with the character set is primarily the setting of three levels of character set, where system-level and instance-level character sets can be modified according to requirements, while database-level datasets must be determined when the library is being built.
(1) Operating system Locale: System-Level code page settings, determining the application's default code page;
If you want to set the OS Locale to Chinese, consider the following method:
UNIX: You can modify the current Locale to Chinese through the export lang= "ZH_CN" command;
Windows: Select the language settings for the system in the Start-> Settings-> Control Panel-> Regional options;
(2) DB2CODEPAGE:DB2 instance-Level code page settings that affect DB2-related applications to make code page decisions when converting code pages.
You can set the Db2codepage to the character set you want through the Db2set db2codepaeg= command.
(3) Database codepage:db2 The code page settings at the DB level, and must be set when the library is being built.
You must specify the code page you want when you create the database:
db2 "CREATE DATABASE dbname USING CODESET UTF-8 TERRITORY CN"
Note: This statement can be used to create a Unicode database for the specified region as China (CN).