Vietnamese characters are garbled after import

孤街浪徒 提交于 2019-12-12 02:41:54

问题


I exported a table in Oracle (which has Vietnamese text) from Dataserver A:

export NLS_LANG=AMERICAN_AMERICA.VN8VN3
exp system/123 BUFFER=64000 FILE=/tmp/export.dmp TABLES=(USERS.AREA) GRANTS=N INDEXES=NO ROWS=Y

And then, I try to import export.dmp to Dataserver B:

export NLS_LANG=AMERICAN_AMERICA.VN8VN3
imp system/123 BUFFER=64000 FILE=/tmp/export.dmp indexes=n grants=n constraints=n statistics=none ignore=y full=y

But, the field ID_ISSUE_PLACE was garbled.

And this is the screenshot which I operated in B. I used the same command to export two tables on A, but after I executed imp command on B,the result is like this! The field COMMENTS in table1 is correct, but the filed NAME in table2 is incorrect.

How to solve this problem?


回答1:


Assuming you are on Windows, and you are using SQL*Plus - it may be as simple as using the proper character set in the COMMAND window. In my case, I have the command $chcp 1252 in my glogin.sql, but from within the session you can do the same with host chcp 1252. This changes the "codepage" (character mapping) to 1252, Microsoft's name for the character set it uses for graphical programs.

For Vietnamese, perhaps the right codepage is not 1252. Take a look at http://www.oracle.com/technetwork/products/globalization/nls-lang-099431.html (and bookmark it for future reference); if I am reading it right, the correct codepage for Vietnamese is 1258.

So: Type host chcp 1258 at the SQL*Plus console and see if it helps. If it does, add $chcp 1258 to your glogin.sql.



来源:https://stackoverflow.com/questions/39249204/vietnamese-characters-are-garbled-after-import

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!