I have an Oracle DB with varchar2 fields that store umlauts. I also have a PHP-application that connects to the DB via ODBC. The whole thing runs on Linux.
The Problem with the Umlauts is now that they are converted to normal letters, e.g. ä => a, but only in the PHP-Application and the isql program. If I use sqlplus or the Oracle web GUI, everything works fine, which tells me that the problem lies in the odbc connection.
I just don't know how to configure ODBC so it uses the right encoding...
Edit The connection is done via
odbc_connect(DSN, User, PW)
I understand that the DSN corresponds to the configurations in either /root/.odbc.ini or /etc/odbc.ini.. which I'm not entirely sure, since I haven't set up the system and I have no experience with ODBC at all. At the moment the DSN is "NAPA", the /etc/odbc.ini file has following settings:
[NAPA]
Driver = Oracle 11g ODBC driver
DSN = OracleODBC-11g
ServerName = localhost
UserID = *****
Password = ****
NLS_LANG = AMERICAN.WE8MSWIN1252
Charset = utf8
The DB parameters are
SQL> SELECT * FROM NLS_DATABASE_PARAMETERS;
+-------------------------------+-----------------------------------------+
| PARAMETER | VALUE |
+-------------------------------+-----------------------------------------+
| NLS_LANGUAGE | AMERICAN |
| NLS_TERRITORY | AMERICA |
| NLS_CURRENCY | $ |
| NLS_ISO_CURRENCY | AMERICA |
| NLS_NUMERIC_CHARACTERS | ., |
| NLS_CHARACTERSET | WE8MSWIN1252 |
| NLS_CALENDAR | GREGORIAN |
| NLS_DATE_FORMAT | DD-MON-RR |
| NLS_DATE_LANGUAGE | AMERICAN |
| NLS_SORT | BINARY |
| NLS_TIME_FORMAT | HH.MI.SSXFF AM |
| NLS_TIMESTAMP_FORMAT | DD-MON-RR HH.MI.SSXFF AM |
| NLS_TIME_TZ_FORMAT | HH.MI.SSXFF AM TZR |
| NLS_TIMESTAMP_TZ_FORMAT | DD-MON-RR HH.MI.SSXFF AM TZR |
| NLS_DUAL_CURRENCY | $ |
| NLS_COMP | BINARY |
| NLS_LENGTH_SEMANTICS | BYTE |
| NLS_NCHAR_CONV_EXCP | FALSE |
| NLS_NCHAR_CHARACTERSET | AL16UTF16 |
| NLS_RDBMS_VERSION | 10.2.0.1.0 |
+-------------------------------+-----------------------------------------+