character encoding problem
804707Oct 12 2010 — edited Oct 12 2010I am developing an application that receives a CLOB from an Oracle database. The Oracle DB is on ISO-8859-1 character set and the CLOB contains european characters. The application runs in a WebSphere Application Server 6.1 on Solaris 10. Solaris has the C locale set as default and the call to Charset.defaultCharset() returns US ASCII 7 as default. This means that the ISO-8859-1 CLOB gets converted into ASCII 7 and all the european characters get lost. The String is modified with an XSLT transformer (as it is an XML String) and send directly to a browser.
How can I make sure that Java doesn't automatically convert the ISO-8859-1 CLOB into a ASCII 7 String? The data must be stored in a String because otherwise the XSLT transformer can't handle it.
The platform's encoding or the JVM startup parameters are fixed and I can't change them nor do I think that this is a good solution because I want my application to be platform independent. And besides, most companies don't allow developers to fiddle with the operating systems parameters.
The difficulty in doing this is a serious flaw in the internationalization capabilities of Java in my opinion, unless my understanding of internationalization is incorrect, in which case it's a serious flaw in my understanding :-)