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")
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).
2. Change the client character set of Informix to UTF-8.
You will need to figure out how to do so.