Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ODBC query charset is always treated as ISO-Latin1 and ignores NLS_LANG

590577Jul 30 2007 — edited Aug 2 2007
Hi, I am using PHP+ODBC+Oracle driver+instantclient to connect to Oracle database and I have problem with national characters in queries.

The database has charset EE8MSWIN1250 and I want to have the same charset on the client, so my NLS_LANG=".EE8MSWIN1250".

The data from the server are fetched right, the data in bind parameters (prepare/execute) are sent right, but the query itself is always sent as ISO-Latin1.

Example - this works fine:
$ret = odbc_prepare($dbh,"insert into TABLE1 values (?)");
odbc_execute($ret,array('ě'));

Example - this works but characters are broken:
odbc_exec($dbh,"insert into TABLE1 values ('ě')");

The problem is that the query itself is always treated as ISO-Latin1 and it does not follow the setting of NLS_LANG, it ignores it completely.

Is it an oracle bug? Is there any way around?

Ubuntu Server 6.06, PHP 5.2.3, unixODBC, instantclient-10.2.0.3, ODBC-Linux-10.2.0.3

I have checked the oci8 extension too, it works fine (charset is part of oci_connect call) but I cannot use it because it clashes with Gupta client for some reason.

Thank you.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 30 2007
Added on Jul 30 2007
1 comment
3,321 views