This week one of our clients experienced an interesting problem. Data obtained from ORACLE database did not display unicode characters. They were either replaced by ‘?’ or some other character.

This happens for one of two reasons (or in worst case scneario both). Either your database has wrong collation or your ORACLE client does. The former is a bit difficult to fix, as you will need to change database collation and existing data. The later is a bit easier. Here is how you do it:

ORACLE client 8.x

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\ORACLE]
"NLS_LANG"="SLOVENIAN_SLOVENIA.EE8MSWIN1250"

ORACLE client 11.x

[HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraClient11g_home1]
"NLS_LANG"="SLOVENIAN_SLOVENIA.EE8MSWIN1250"

I had to set Slovenian WIN1250 ecnoding and this is what sample does. More languages and options can be found in ORACLE documentation here and here.