Search code examples
oracleencodingplsqldeveloper

Oracle client encoding


I am trying to make development environment on other pc. Installed oracle client 19, PL/SQL Developer.

Here is nls_parameters from server:

Accordingly i set NLS_LANG on client in registry:

But, i still get nonsense in PL/SQL Developer:

And in sqlplus:

SQL> select * from adm_org;

    ORG_ID
----------
ORG_NAME
--------------------------------------------------------------------------------
ORG_FULL_NAME
--------------------------------------------------------------------------------
         1
─σ≡µαΓφΦΘ ßε≡π
╙∩≡αΓδ│φφ  Σσ≡µαΓφΦ∞ ßε≡πε∞

         2
╠╘╬ ≥α ╠╥─
╙∩≡αΓδ│φφ  ╠╘╬ ≥α Ωεε≡ΣΦφα÷│  ╠╥─

Then i tried this with SQL Developer and it was a successful. But SQL Developer uses separate client to connect to Oracle. It seems that it uses Cp1252. Supported character sets only have WE8MSWIN1252 and it didn't fixed the problem.

What am i missing? Character set supposed to be the same on client and server? I have never had such problems before, everything was fixed by setting NLS_LANG.


Solution

  • SQL Developer is a Java/JDBC based client, it does not use NLS_LANG settings.

    PL/SQL Developer I do not know, have a look at the settings.

    sqlplus inherits characters set from command line. Try this

    chcp 1251
    SET NLS_LANG=.CL8MSWIN1251
    sqlplus ...
    

    It is not required to have the same character set on database and client (although it is a good idea to have them the same). Important part is that NLS_LANG value declares the real character set which is used by the client. And the client character set should support all characters which are supported by the database.

    See also OdbcConnection returning Chinese Characters as "?"