Getting SQLPlus to spool out Unicode characters, are being output as?
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 "e开发者_StackOverflown_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.
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
精彩评论