Test Report on character sets-MySQL

Source: Internet
Author: User
Test report about character sets: nls_lang is used to set the character set of the client. Language that affects the sqlplus interface.

Regedit:
Hkey_local_machine/software/oracle/home0
Nls_lang key value
1. The value is 'us7ascii 'or null.
2. set the value to 'simplified chinese_china.zhs16gbk'

Nls_characterset is used to set the internal character set of the database and determine the format of data record storage.
1. The value is 'us7ascii 'or null.
2. set the value to 'zhs16gbk'

Test: environment (a table already exists as test_char. contains Chinese characters)
1> client. the server character set is ZHS16GBK:
. Test_char is displayed correctly.
. Tables containing Chinese character records can be correctly created.
. Import xiejia. test_char to the test mode.
The ZHS16GBK and AL16UTF16 NCHAR character sets have been exported.

2> the client is ZHS16GBK, and the internal character set of the server is US7ASCII.
. Test_char cannot be displayed normally.
The table containing Chinese character records cannot be displayed normally.
. During the execution of the export.
The ZHS16GBK and AL16UTF16 NCHAR character sets have been exported.
The server uses the US7ASCII character set (possible character set conversion)

3> the client is US7ASCII, and the internal character set of the server is US7ASII.
. Test_char is displayed normally.
The table containing Chinese character records cannot be displayed normally.
. During the execution of the export
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
After the import process is executed, the imported content cannot be displayed normally.

4> the client is ZHS16GBK, and the internal character set of the server is US7ASCII.
. Test_char cannot be displayed normally.
The table containing Chinese character records cannot be displayed normally.
. During the execution of the export
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
Server uses ZHS16GBK character set (possible charset conversion)

Summary:
The setting of uls_lang on the client determines the character set to be exported.

In the oracle9i Database, the client character set must be of the same type as the database core character set; otherwise, Chinese characters may be garbled.

Related tables:
V $ nls_parameters
Nls_database_parameters
Props $

Retention questions:

If the character set on the client and server are both US7ASCII, cannot a table containing Chinese characters be properly displayed? Is it because US7ASCII does not support Chinese characters?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.