Oracle 10g sqlplus Chinese display and input in Linux

Source: Internet
Author: User

Generally, the Oracle code we use is UTF-8.

First we use the client securitycrt set the character encoding is utf8, even if sqlplus query is correct and return the corresponding UTF-8 format value is not correctly displayed drops.

Export lang = zh_CN.UTF-8
(Front-end encoding during login)

Lang variable is short for language. This variable determines the default language of the system, that is, the system menu,ProgramTool bar language and default language of the input method.
Lang variable is cleared. because English is supported in any situation, after Lang variable is cleared, the system uses English by default. After this setting, the error messages output in character mode are all in English. However, this setting is temporary, but it only changes the bash variable Lang temporarily. It is invalid when you log out and log on again or switch to another character terminal.

Export
Nls_lang = american_america.utf8
(Solve the problem of front-end encoding in Oracle in sqlplus)

"The nls_lang and database character sets are the same, but they are often incorrect. Do not think that nls_lang must be the same as the character set of the database. This is often wrong ." In step-by-step Oracle, the same way as nls_lang can improve performance because Character Set conversion is not required. In fact, such a conversion occurs on the server from time to time. After the client completes the conversion, it is passed to the server. In my opinion, as long as nls_lang is a subset of the server's character set.

"The Character Set setting of nls_lang does not change the character set of the client. It is only used to tell Oracle what character set you use on the client. You cannot set nls_lang to affect the character set of the client ". In addition, if the character set of the client is not compatible with nls_lang, database garbled characters may occur.

"If you do not set nls_lang on the client side, the nls_lang settings of the server will be used by default. This is incorrect. If Oracle does not
If you set nls_lang, the default value is american_america.us7ascii. Language is
American, region is America, Character Set us7ascii"

"Set the language and
The Territory part does not affect the characters stored in the database. Setting nls_lang to japanese_japan.we8mswin1252 will not allow you to store logs
Text. Because the we8mswin1252 character set does not support Japanese. However, setting it to american_america.ja16sjis will allow you to store Japanese files. Assume that the characters you entered are
Is ja16sjis, and the character set of the database also supports Japanese (such as utf8 or ja16sjis )"

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.