Ö and other special characters not getting saved correctly in the client data base

550 Views Asked by At

When I execute the code at my end, the characters get saved correctly. But when the same code with the same data is executed at client side, the characters change when they are written to the database and that causes issues when they are displayed on a screen. The datatype of the column is varchar2.

Initially, I thought that the character set of the database at their end would be different from mine so I asked for the NLS parameters from the client. Turns out, the character set is the same but the language and territory is different. I think it could be causing this problem but I am not sure. If yes, how can I ask them to change it?

Paramter            Client        Me
NLS_CHARACTERSET    AL32UTF8      AL32UTF8
NLS_LANGUAGE        GERMAN        AMERICAN
NLS_TERRITORY       AUSTRIA       AMERICA

Please tell me if I need to put more information.

EDIT: Issue was not with the database character set, it was with the application. Fixed this issue after adding -Dfile.encoding=UTF-8 in jvm arguments.

1

There are 1 best solutions below

0
ekochergin On

You can either ask the user to perform following command (via cmd on windows) for the current session only

set NLS_LANG=GERMAN_AUSTRIA.AL32UTF8

and then start your app from the same session to test if possible.

Be aware that all the database messages will be automatically translated to German language, like this

SQL> jj
SP2-0042: Unbekannter Befehl "jj" - restliche Zeile wurde ignoriert.

This might be annoying in case you are sending "raw" oracle message to a non-german speaking client

Once test is successfully done, you might either set system variable NLS_LANG to a value a gave you before or go to registry editor on a client windows machine (if applicable) and set the NLS_LANG parameter value for the Oracle home under

HKLM\Software\Oracle

That will change the parameter for any session customer starts