Wrong Codepoints Retrieved With JDBC For XMLType Containing Special Characters With Database Characterset WE8ISO889P1 (Doc ID 1612839.1)

Last updated on MARCH 08, 2017

Applies to:

JDBC - Version 11.2.0.4.0 and later
Information in this document applies to any platform.

Symptoms

Given a database created with database characterset WE8ISO889P1, corrupt characters are retrieved with JDBC 11.2.0.4.
The same data can be retrieved successfully with sqlplus when NLS_LAN is set to American_America.W8ISO8859P1.

Issue can be reproduced with the following steps:

1. Create a table as follows:
create table mytab (c1 varchar2(100), c2 varchar2(100), c3 number);

2. Then, insert a row with special characters:

  insert into mytab values ('Uno','Frédéric Fröhlich',123);
  commit;

3. From sqlplus, the results are the expected:

SQL> select * from mytab;

C1 C2 C3
------ --------------------- ------
Uno Frédéric Fröhlich 123


4. From JDBC , the characters are displayed incorrectly:

$ java mytab
Default Charset=UTF-8
file.encoding=UTF-8
Default Charset=UTF-8
Default Charset in Use=UTF8
JDBC Connection opened
Successfully created Session
Uno Frédéric Fröhlich 123

Note that character set in java session is always UTF-8, when expected to be WE8IS8859P1.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms