选择NLS_LANG for Oracle [英] choosing NLS_LANG for Oracle

查看:140
本文介绍了选择NLS_LANG for Oracle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据网站,
http://www.dba-oracle.com /t_nls_lang.htm

即使数据库和客户端都使用相同的字符集(AL32UTF8),也可能会出现问题。我不明白这是怎么可能的。
从网站引用:

Problem might occur even if both the database and the client use the same characterset(AL32UTF8). I couldn't understand how this can be possible. Quoting from the site:


例如,假设数据库字符集是AL32UTF8,
客户端英文Windows操作系统和客户端上的NLS_LANG
设置是AL32UTF8。 进入数据库的数据是
编码在WE8MSWIN1252
中,并且不会转换为AL32UTF8数据
,因为客户端上的NLS_LANG设置与数据库
字符集匹配。因此,Oracle假定不需要转换,
和无效数据输入数据库。

For example, suppose that the database character set is AL32UTF8, the client is an English Windows operating system, and the NLS_LANG setting on the client is AL32UTF8. Data coming into the database is encoded in WE8MSWIN1252 and is not converted to AL32UTF8 data because the NLS_LANG setting on the client matches the database character set. Thus Oracle assumes that no conversion is necessary, and invalid data is entered into the database.

数据如何当客户端的编码是AL32UTF8?时,作为WE8MSIN1252进入数据库。

How can the data be coming as WE8MSIN1252 into the database when the encoding in the client is AL32UTF8?.

推荐答案

因为OS本身使用其他字符集(在这种情况下为WE8MSIN1252)。但是由于NLS_LANG(在客户端上)设置为AL32UTF8,Oracle不知道这一点。 Oracle总是使用NLS_LANG中的值并忽略系统设置,而(几乎)所有其他软件都使用操作系统设置。

Because OS itself using other character set (WE8MSIN1252 in this case). But since NLS_LANG (on client) is set to AL32UTF8, Oracle does not know about this. Oracle always uses value in NLS_LANG and ignores system settings, while (almost) all other software uses OS settings.

因此,要解决此问题,本地(客户端)NLS_LANG必须与操作系统字符集相同。或者(其他选项)在客户端运行的软件本身必须重新编码字符。

So, to fix this problem, local (client) NLS_LANG must be the same as OS character set. Or (other option) software running on client must reencode characters by itself.

这篇关于选择NLS_LANG for Oracle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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