Strange Euro sign handling

From: Franz Kruse <Franz.Kruse_at_t-online.de>
Date: Sat, 11 Aug 2012 16:49:35 +0200
Message-ID: <k05rdu$kfq$1_at_news.albasani.net>



Dear Oracle experts,

maybe one of you can explain a phenomenon we observe:

We are using an Oracle 9i database on a Solaris server as part of a web based system with both Perl and Java programs accessing the database. The database uses the WEISO8859P1 (Latin-1) character set, in which the Euro sign does not exist.

Nevertheless, the system does handle the Euro sign. We can insert Euro signs through web forms and get them properly displayed in web pages generated from database queries - as long as done through Perl programs. When doing queries from Java, the situation is different:

  • For VARCHAR fields, the ResultSet method getString() yields 0x0080 for a Euro sign (which is the Windows-1252 encoding).
  • For CLOBs (CLOB object obtained by the OracleResultSet method getCLOB()), the result depends on the kind of access:
    • When using getAsciiStream() and creating an InputStreamReader with encoding ISO-8859-1 from it, we get 0x00FD for a Euro sign.
    • When using getCharacterStream(), we get 0xFFFD (which is the Unicode representation of an invalid character).

What does the Oracle database actually do with the Euro signs? How can the observed effects be explained?

Franz Received on Sat Aug 11 2012 - 09:49:35 CDT

Original text of this message