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 character sets, which was very 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: (here 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 the number of cp936 is 171, you need to set the system character set to this ID in the Sybase attribute, as shown in: 2. If character integration fails, the reason is that the tablespace of the master database is allocated only several hundred kb by default, and there is no enough space after the new data is imported. Therefore, you need to set a larger tablespace for the master database, right-click the master database, select the tab of the tablespace, edit and re-allocate the size of the original tablespace, and assign all the tablespaces of the master database to solve the problem. 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 open ie. I don't know why.Re-execute the scriptThis is because the default character set is cp850, so the script executed under this 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.