How to store Unicode characters in Oracle?

I have an Oracle database. I tried to stored Arabic characters in a table, but it leads to reverse question marks in the database. The datatype of the column is VARCHAR2.

I used the following query to check the characterset.

SELECT * FROM NLS_DATABASE_PARAMETERS 

The characterset is WE8MSWIN1252. How can I handle it?

SQL> select * from nls_database_parameters ORDER BY PARAMETER;

      PARAMETER                      VALUE
      ------------------------------ ---------------------------------------
      NLS_CALENDAR                   GREGORIAN
      NLS_CHARACTERSET               WE8MSWIN1252
      NLS_COMP                       BINARY
      NLS_CURRENCY                   $
      NLS_DATE_FORMAT                DD-MON-RR
      NLS_DATE_LANGUAGE              AMERICAN
      NLS_DUAL_CURRENCY              $
      NLS_ISO_CURRENCY               AMERICA
      NLS_LANGUAGE                   AMERICAN
      NLS_LENGTH_SEMANTICS           BYTE
      NLS_NCHAR_CHARACTERSET         AL16UTF16

      PARAMETER                      VALUE
      ----------------------- ----------------------------------------
      NLS_NCHAR_CONV_EXCP            FALSE
      NLS_NUMERIC_CHARACTERS         .,
      NLS_RDBMS_VERSION              11.2.0.3.0
      NLS_SORT                       BINARY
      NLS_TERRITORY                  AMERICA
      NLS_TIMESTAMP_FORMAT           DD-MON-RR HH.MI.SSXFF AM
      NLS_TIMESTAMP_TZ_FORMAT        DD-MON-RR HH.MI.SSXFF AM TZR
      NLS_TIME_FORMAT                HH.MI.SSXFF AM
      NLS_TIME_TZ_FORMAT             HH.MI.SSXFF AM TZR

      20 rows selected.


ANSWERS:


Do yourself (and all other people working on the database) a favor and upgrade your database to use AL32UTF8 as the default database character set. It's a bigger one time effort than using NVARCHAR2 for a few selected columns but it saves a lot of work and trouble in the future.

See Character Set Migration for instructions.


You cannot store arabic characters in the character set WE8MSWIN1252.

But there is an escape route: the national character set.
If you define the column as NVARCHAR2 instead of VARCHAR2, any character can be stored in it.



 MORE:


 ? Displaying UTF-8 encoded Chinese characters in R
 ? Displaying UTF-8 encoded Chinese characters in R
 ? Displaying UTF-8 encoded Chinese characters in R
 ? Why do some Unicode characters display in matrices, but not data frames in R?
 ? how to read data in utf-8 format in R?
 ? Reading Chinese characters in R
 ? UTF-8 Width Display Issue of Chinese Characters
 ? Display chinese characters WITHOUT using utf8 encoding?
 ? UTF-8 and Chinese Characters
 ? How to show Chinese characters correctly in rCharts