View Unicode data using Oracle SQL*Plus in Unix
Problem:
Unicode data is not showing from SQL*Plus properly. In the following example € sign showing as ?
[username@servername ~]$ sqlplus username@test_db
SQL*Plus: Release 11.2.0.3.0 Production on Tue Nov 15 15:29:50 2016
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
Session altered.
SQL> select content from transaction_data where TRANSACTIONID=30902132187;
CONTENT
--------------------------------------------------------------------------------
Cout : 8,00?.
Solution
Change Putty Setting:
If you are using Putty, your Putty session needs it's Translation setting to be changed to UTF-8 before it can be displayed correctly.
Set the NLS_LANG parameter correctly:
[username@servername ~]$ export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
[username@servername ~]$ sqlplus username@test_db
SQL*Plus: Release 11.2.0.3.0 Production on Tue Nov 15 15:30:43 2016
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
Session altered.
SQL> select content from transaction_data where TRANSACTIONID=30902132187;
CONTENT
--------------------------------------------------------------------------------
Cout : 8,00€.