导入后越南语字符乱码 [英] Vietnamese characters are garbled after import

查看:372
本文介绍了导入后越南语字符乱码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从数据服务器A中导出了Oracle表(带有越南语文本):

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

然后,我尝试将export.dmp导入到数据服务器B:

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

但是,字段ID_ISSUE_PLACE是乱码.

这是我在B中操作的屏幕截图. 我使用相同的命令在A上导出两个表,但是在B上执行imp命令后,结果是这样的!表1中的COMMENTS字段正确,但表2中的字段名称不正确.

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?

推荐答案

假定您在Windows上,并且正在使用SQL * Plus-它可能与在COMMAND窗口中使用正确的字符集一样简单.就我而言,我的glogin.sql中有命令$chcp 1252,但是在会话中,您可以对host chcp 1252执行相同的操作.这会将代码页"(字符映射)更改为1252,即Microsoft用于图形程序的字符集的名称.

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.

对于越南语,也许正确的代码页不是1252.请查看

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.

所以:在SQL * Plus控制台上键入host chcp 1258,看看是否有帮助.如果是这样,请在您的glogin.sql中添加$chcp 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.

这篇关于导入后越南语字符乱码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆