February 17, 2003

XML, XSLt, JDBC, accents & oracle nightmare

I think I've gotten over my head today... It had started out nicely : just making sure all the automated tests would run in anthill... which means in ant. But JUnitReport needed xalan 2 so added it to the classpath and started getting linkage errors.

All right then.. I'll just clean the classpath, well that was bad enough, see me previous posts but now... all my accented characters are showing up as question marks !

So I started looking into java character encodings... UTF-8, UCS-2, ISO-8859-1... Ok so we're using latin-1 which appears to be 8859-1 but guess what... eclipse & java in linux use ANSI_X3.4_1968... never heard of it !! So now I've figured out how to actually SEE accented characters in my eclipse text editor now... wow ! I also make sure all the character incodings of xml snippets that get inserted into the file are correct and that all files have an encoding declaration. I also make sure the xsl:output statement is correct in each xsl...But that still didn't work

So I looked at the file.encoded system property. It says ASCII while the default character encoding on inputstreams is that ANSI thing... Ok, let's start weblogic with -Dfile.encoding=ISO-8859-1, that doesn't do it yet...

If I do an xsl transformation using my XmlFile class on a file I build in the class (including accents), it works fine... humm... could it be the JDBC driver ?

well, it seems like doing resultSet.getString() on a column with an accent makes it disappear (ie... é becomes e) but my database is setup to use WE81508859P1 which according to oracle's docs should be seemlessly converted to UCS-2 which therefore should handle accents correctly.

I'm stumped... anyone ??

Posted by pgirolami76 at February 17, 2003 07:03 PM | TrackBack
Comments

Quand j'ai un problème de ce type - longue chaîne causale où le problème semble "disparaître", on ne voit pas à quel point précis il peut se cacher - j'essaie "d'assurer" mon analyse, comme on s'assure en escalade, en plantant des tests unitaires à divers points de la chaîne. Un test pour vérifier que la transformation XSL préserve les accents... Un pour m'assurer que le prologue XML n'a rien à voir dans l'histoire... Etc.

Je sais que je tiens quelque chose quand j'arrive à avoir un test unitaire qui échoue *et* je sais que si ce test échoue, il est "normal" que j'observe le comportement qui m'inquiète. A partir de ce moment je n'ai peut-être pas une solution, mais j'ai au moins mis le doigt sur le problème.

YMMV (et je ne sais pas pourquoi je réponds en français à un post en anglais, mais c'est comme ça...)

Posted by: Laurent Bossavit at February 18, 2003 05:31 PM
Post a comment









Remember personal info?