This discussion is archived
3 Replies Latest reply: Feb 1, 2008 11:44 AM by 370622 RSS

Compatible NLS_LANG for Oracle and Informix

370622 Newbie
Currently Being Moderated
Hello All,

What is the compatible NLS_LANG setting that supports both Informix (IDS 9.4) and Oracle (10.2G)?

We have Python (v2.5) programs which retrieve the data from Informix and Oracle are giving different encoding. For e.g ü character is getting encoded as "\xfc" from Informix and same character is getting encoded as "\xc3\xbc" from Oracle.

We are setting NLS_LANG to AL32UTF8 in Python as: os.putenv("NLS_LANG","_.AL32UTF8")

OS: Lunix SuSE.

Thanks in advance.
  • 1. Re: Compatible NLS_LANG for Oracle and Informix
    cj Employee ACE
    Currently Being Moderated
    Tough question. I don't know anything about Informix. I'll forward your question to someone who at least knows Oracle NLS in depth.

    -- cj
  • 2. Re: Compatible NLS_LANG for Oracle and Informix
    438237 Newbie
    Currently Being Moderated
    In order to move character data between two databases, the both database access drivers need to be configured to use the same character encoding.

    For cx_oracle, you can control the client character encoding using NLS_LANG environment parameter. Since you are setting it to "_.AL32UTF8", you get 0xc3 0xbc for the "LATIN SMALL LETTER U WITH DIAERESIS" character as expected.

    Although I'm not familiar with Informix, from the fact that you are getting 0xfc for the "LATIN SMALL LETTER U WITH DIAERESIS" character, it can be said that your Informix access driver is configured to use Latin-1 for the client character encodng.

    You can either:

    1. Change the client character set of cx_oracle to WE8ISO8859P1 (Latin-1).
    Do: os.putenv("NLS_LANG","_.WE8ISO8859P1")

    2. Change the client character set of Informix to UTF-8.
    You will need to figure out how to do so.
  • 3. Re: Compatible NLS_LANG for Oracle and Informix
    370622 Newbie
    Currently Being Moderated
    Thanks Mtozawa.

    Changing to os.putenv("NLS_LANG","_.WE8ISO8859P1") heped in getting same encoding (single) for Informix and Oracle.