PL/SQL sets the encoding method, and plsql sets the Encoding
(21:38:33)Reprinted token
| Tags: Miscellaneous |
Category: ORACLE |
Garbled characters occur when exporting SQL files. Baidu later found that the problem was caused by inconsistent character encoding settings between the PL/SQL client and ORACLE. (There was a prompt when I logged on to PLSQL/Developer, but I didn't care about it). The online information is as follows:
When you log on to PLSQL/Developer, the system prompts that the character encoding settings on the client and server are inconsistent.
Some methods for setting and querying the oralce character encoding are recorded as follows:
1. Composition of the NLS_LANG Parameter
The NLS_LANG parameter consists of the following parts:
NLS_LANG = _.
The meanings of NLS_LANG are as follows:
LANGUAGE:-the LANGUAGE in which Oracle messages are sent.-The month in the date and the day are displayed.
TERRITORY specifies-currency and number format;-region and week and date calculation habits
CHARACTERSET:-controls the character set used by client applications. It is usually set to or equal to the client (such as Windows) code page, or UTF8 for unicode applications.
Select * from v $ nls_parameters;
LANG = zh_CN.GBK
NLS_LANG = "SIMPLIFIED CHINESE_CHINA.ZHS16GBK"
In the window, you can also modify my PC-> properties-> advanced-> environment variables-> NLS_LANG to directly modify and restart pl/SQL.
AMERICAN_AMERICA.WE8ISO8859P1 of iso8859
SIMPLIFIED CHINESE_CHINA.ZHS16GBK of gbk
My solution is to open the runner and go to the Registry for editing.
Run --> regedit (Registry)
--> Value of NLS_LANG in HKEY_LOCAL_MACHINE \ SOFTWARE \ ORACLE \ KEY_OraDb11g_home1
SIMPLIFIED CHINESE_CHINA.ZHS16GBK
Change to the following values:
SIMPLIFIED CHINESE_CHINA.AL32UTF8 (server-side encoding --- ORACLE encoding)
Then restart pl/SQL developer
Select userenv ('language') from dual; -- query the encoding method of ORACLE