问题
I am having problems with an Oracle Database and the ASCII char encoding.
I'm trying to make Update sentences on Varchar2() columns with strings that contains special characters like á, é, í, ó, ú, (spanish) etc.
Each time i recover the data from that column, as for example, instead of seeing 'ó', i got '髇' or '髇'.
I'm writing Update sentences like:
UPDATE TABLE_1
SET DESCRIPTION = 'THIS IS A TEXT WITH SPECIAL CHAR ó ÉND'
WHERE ID = '1';
and when i do:
SELECT ID ||' | '|| DESCRIPTION FROM TABLE_1 WHERE ID = '1';'
I got:
1 | THIS IS A TEXT WITH SPECIAL CHAR 髇 END
I'm using SQL Developer Version 4.0.3
Thank you for the help.
回答1:
You have to check the Nlslang in you registery and the database characterset, it seems they are different.
Example:
SELECT * FROM v$nls_parameters WHERE parameter LIKE 'NLS_CHARACTERSET'
/
PARAMETER VALUE
---------------------------------------------------------------- ----------------------------------------------------------------
NLS_CHARACTERSET AL32UTF8
from the registery go to oracle registery and in nlslang add value American_America.Al32UTF8
(as an example) similar what you have in the database.
By the way sometime also the issue its from the langauge in the control panel , if you want to use french characters is better to assign it french. (Control Panel\Clock, Language, and Region... then in administrative tab)
来源:https://stackoverflow.com/questions/52963049/sql-developer-special-chars