Getting SQLPlus to spool out Unicode characters, are being output as?

早过忘川 提交于 2019-12-07 00:34:30

问题


I am attempting to get Oracle sqlplus (10.2) to spool out Unicode data on a Linux machine. I have found several discussions of this issue, but no clear answers, other than to check locale settings and set NLS_LANG to AL32UTF8. All locale info is set to "en_US.UTF-8", I'll post the full output upon request.

The OS (vi, etc.), will recognize and accept Unicode characters without issue. However, when using sqlplus, all non-ASCII characters are changed to ? characters. The Oracle DB has NLS_CHARACTERSET set to AL32UTF8, and NLS_NCHAR_CHARACTERSET set to AL16UTF16.

Am I missing some setting or switch that needs to be set for sqlplus itself? Any ideas would be much appreciated.


回答1:


I found the answer to this. Apparently, setting NLS_LANG (the correct setting is AMERICAS_AMERICA.AL32UTF8) in the shell script does not work. It must be exported:

export NLS_LANG=AMERICAN_AMERICA.AL32UTF8


来源:https://stackoverflow.com/questions/7179181/getting-sqlplus-to-spool-out-unicode-characters-are-being-output-as

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