0

When I insert the Windows-1252 (80-9F) control characters from sql developer in windows, they get inserted correctly into oracle db.

But when I use sqlplus in linux server, the control characters are inserted as � in same db.

For example, when I execute below statement in linux server sqlplus,

insert into demo values ('“a”');

I get the below output inserted in db:

�a�

Samething happens for other control characters like Œ, Ž, Š, ‹, etc..

My locale setting:

LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"

Can someone help me?

1 Answers1

0

Your Linux box is using UTF-8 (LANG=en_US.UTF-8) so you need to tell SQL*Plus that everything you type is using that encoding. The way to do so (the only way to do so, as far as I know) is to create the NLS_LANG env variable and asign it the Oracle code for UTF-8—I've found two different values in the docs I've googled into:

NLS_LANG=American_America.UTF8
NLS_LANG=AMERICAN_AMERICA.AL32UTF8

The Oracle Database Client Globalization Support doesn't shed much light on the subject but I've always used AMERICAN_AMERICA.AL32UTF8.

Community
  • 1
  • 1
Álvaro González
  • 142,137
  • 41
  • 261
  • 360