cx_Oracle: Non-ASCII characters handling with different versions

dwahli at gmail.com dwahli at gmail.com
Fri Nov 16 12:34:35 CET 2007


On Nov 14, 2:03 pm, Benjamin Hell <bh... at spamfence.net> wrote:
> It's solved: Because of a local full Oracle DB installation the
> "working" box had the registry key
> HKEY_LOCAL_SYSTEM\SOFTWARE\ORACLE\KEY_OraBD10g_home1\NLS_LANG set to
> "AMERICAN_AMERICA.WE8MSWIN1252". A similar key was missing on the
> other box. I added HKEY_LOCAL_SYSTEM\SOFTWARE\ORACLE\NLS_LANG with
> the same value and now it works.

You could use environment variable NLS_LANG to set it at run time
with:

os.environ["NLS_LANG"] = "AMERICAN_AMERICA.WE8MSWIN1252"
import cx_Oracle
...

This way you don't have to deal with registry on each box.
Note that os.environ["NLS_LANG"] must be BEFORE import cx_Oracle.

Domino



More information about the Python-list mailing list