This discussion is archived
3 Replies Latest reply: Mar 10, 2013 12:13 PM by Zoltan Kecskemethy RSS

NLS setting to display Cyrillic alphabet

user13080027 Newbie
Currently Being Moderated
NLSRTL      11.2.0.1.0     Production
Oracle Database 11g Enterprise Edition      11.2.0.1.0     64bit Production
PL/SQL      11.2.0.1.0     Production
TNS for Solaris:      11.2.0.1.0     Production
OS: Solaris 10 x86

The NLS settings for my database are:
SELECT * FROM nls_database_parameters;

1     NLS_LANGUAGE     AMERICAN
2     NLS_TERRITORY     AMERICA
3     NLS_CURRENCY     $
4     NLS_ISO_CURRENCY     AMERICA
5     NLS_NUMERIC_CHARACTERS     .,
6     NLS_CHARACTERSET     AL32UTF8
7     NLS_CALENDAR     GREGORIAN
8     NLS_DATE_FORMAT     DD-MON-RR
9     NLS_DATE_LANGUAGE     AMERICAN
10     NLS_SORT     BINARY
11     NLS_TIME_FORMAT     HH.MI.SSXFF AM
12     NLS_TIMESTAMP_FORMAT     DD-MON-RR HH.MI.SSXFF AM
13     NLS_TIME_TZ_FORMAT     HH.MI.SSXFF AM TZR
14     NLS_TIMESTAMP_TZ_FORMAT     DD-MON-RR HH.MI.SSXFF AM TZR
15     NLS_DUAL_CURRENCY     $
16     NLS_COMP     BINARY
17     NLS_LENGTH_SEMANTICS     BYTE
18     NLS_NCHAR_CONV_EXCP     FALSE
19     NLS_NCHAR_CHARACTERSET     AL16UTF16
20     NLS_RDBMS_VERSION     11.2.0.1.0
As you can see I set the value "AL32UTF8" for character set of the db in order to be able to store strings in different languages.

The problem is that when I insert data from SqlPlus in Cyrillic and then try to display it in a browser, I don't see it properly, although the web-page is set to encoding UTF-8.

If I insert the data from a web-page form to the table in the db and then display it, I see it properly, as obviously I provided data encoded in UTF-8 and again displayed in UTF-8.

However if I try to query this data from SqlPlus or PL/SQL Developer (the UTF-8 encoded data which I previously inserted from a web-page form) I see something like:
Регистрационна форма ...

Please, can you help to figure out where is the problem? Why is the encoding messed up when I query UTF-8 encoded data in Cyrillic from the database?

It is pretty much the same with any non-English alphabet. For example, if I insert "Verfügung ermöglichen" in the database will be written: "VerВfГјgВung erВmГ¶gВlichen"

What is misconfigured?
Thank you!
  • 1. Re: NLS setting to display Cyrillic alphabet
    damorgan Oracle ACE Director
    Currently Being Moderated
    What is misconfigured? Possibly your operating system but you didn't provide DDL so we have no idea how you defined the table column for the string.

    Also note this from your listing:
    6     NLS_CHARACTERSET     AL32UTF8
    ...
    19     NLS_NCHAR_CHARACTERSET     AL16UTF16
  • 2. Re: NLS setting to display Cyrillic alphabet
    Srini Chavali-Oracle Oracle ACE Director
    Currently Being Moderated
    Looks to be an issue with how you are using SQL*Plus and PL/SQL Developer. Can you reproduce the issue with SQL Developer client ?

    HTH
    Srini
  • 3. Re: NLS setting to display Cyrillic alphabet
    Zoltan Kecskemethy Expert
    Currently Being Moderated
    First I would need to repeat myself:
    If you have My Oracle Support (MOS) access you may want to read the following documents.
    [url https://metalink.oracle.com/metalink/plsql/showdoc?db=NOT&id=264157.1]The correct NLS_LANG setting in Unix Environments Doc ID 264157.1
    [url https://metalink.oracle.com/metalink/plsql/showdoc?db=NOT&id=179133.1]The correct NLS_LANG in a Windows Environment Doc ID 179133.1,
    Added in windows one because I dont know where you run your sqlplus...

    If you run it in a *nix system.
    Ensure:
    - You connecting terminal uses UTF8 encoding (e.g. putty Window/Translation/Character set is UTF8)
    - your console locale is UTF8 (see output of locale command, if not "en_US.UTF-8" use: export LC_ALL="en_US.UTF-8" if you can see utf8 available in "locale -a" available locales list)
    - NLS_LANG set e.g. AMERICAN_AMERICA.AL32UTF8
    - your input script is UTF8 encoded
    if all these are setup well you should be good to go since your database can accept UTF8 characters.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points