Changing the NLS_LANG
value does not affect any data in the database. However setting character set to WE8ISO8859P1
will not work.
When you set NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
then you tell the database "The client uses character set WE8ISO8859P1." Thus any Mandarin characters will not be accepted by the database because they are not supported by WE8ISO8859P1.
Use AL32UTF8
or any other character set which supports Mandarin, for example ZHS32GB18030
Apart from that, Java does not use the NLS_LANG
setting at all, see Database JDBC Developer's Guide - Globalization Support:
Starting from Oracle Database 10g, the NLS_LANG variable is no longer
part of the JDBC globalization mechanism. The JDBC driver does not
check NLS environment. So, setting it has no effect.
Please have a look at this document how to setup Unicode in Java environment.
Of course, the database NCHAR Character Set has to support Mandarin. Usually this is set to default AL16UTF16
, so I assume that's not the issue here.