I have an ODBC datasource to an Oracle database.
The table I select data from has varchar2
columns containing e.g "kg/m³" or "°C".
Now using an ODBCConnection in my c# application, the OdbcDataReader
returns "kg/m? and "?C".
Checking the NLS parameters with:
SELECT *
FROM V$NLS_PARAMETERS
WHERE PARAMETER IN ('NLS_CHARACTERSET', 'NLS_NCHAR_CHARACTERSET');
returns AL32UTF8
for NLS_CHARACTERSET
and AL16UTF16
for NLS_NCHAR_CHARACTERSET
.
If I change the column type to NVARCHAR
, the OdbcDataReader
returns the right value.
But changing the table columns is not an option because the database is also used by other applications.
Is there any way to get the right value by setting any parameter on the connection, command or reader objects?
Thanks, Cew3
Edit:
Setting the system environment NLS_LANG
to GERMAN_GERMANY.AL32UTF8
(and rebooting the machine!) solved the problem!
Thank you all for the hints/comments!