Garbled characters were encountered when building a test database server. It was not because the development database server had been installed and set up character sets long ago. Therefore, some problems occurred only when the test environment was deployed, at that time, the database has been configured, all the initialization scripts have been executed, and the project has been successfully deployed on WebLogic. Open IE and run the program, it is found that all the information read from the database is garbled. the character set needs to be set for relevant materials searched online, but the information found at the beginning is basically a word phrase, no system has explained how to set character sets. Almost all of their methods have been tried. The results have not been completed, and even the console and SQL platform are garbled, I couldn't understand it, so I went to ask Gao Ren. He sent me a document dedicated to explaining character sets, which was comprehensive and finally solved the garbled problem through his help.
Below I will summarize the process of setting character sets:
1. After Sybase is installed, if you want to set the character set to CP936, you must first install the character set because the default character set table of Sybase does not have this character set, the installation procedure is as follows: (the installation path of SYBASE is c: \ sybase) 1.c:\>; cd \ sybase \ charsets \ cp936 2.c:\ sybase \ charsets \ cp936>; charset-Usa-Psa_pass-Sserver_name binary. srt cp936 successfully installs the CP936 character set in the system character set table of Sybase through the preceding command. However, you must restart the Sybase service twice to see the result, you can check the syscharsets table in the master database to check whether the installation is successful. We can see that the installation is successful: 1002,171, 'cp936', 'cp936 (Simplified Chinese ). ','... '
2. If CP936 is numbered 171, you must set the system character set to this ID in the Sybase attribute, as shown in:
If character integration is set, the error occurs because the tablespace in the master database is allocated only several hundred kb by default, and there is no enough space after new data is imported, therefore, you need to set a larger tablespace for the master database, right-click the master database attribute, select the tab page of The tablespace, and edit and re-allocate the size of the original tablespace, you can solve this problem by allocating all the tablespaces of the master.
3. After setting the character set, you can execute the initialization script. There are several other episodes in this article. Since the error of insufficient tablespace in step 2 is not described in any document, Guo liying and I have no idea at all, we thought Sybase had crashed. We had no way to reinstall it, but this problem still exists after installation. Later, ask someone to help us to see that it was a problem with table space, in addition, even though the character set is set, it is still garbled when I enable IE. I don't know why, but after I re-execute the script again, it's because the default character set is Cp850, therefore, the script executed in the character set must be garbled when it is read to the CP936 environment. Therefore, it is no problem to execute the script again in the CP936 environment.