Java application failing on special characters.

Posted by Scottm on Stack Overflow See other posts from Stack Overflow or by Scottm
Published on 2008-10-30T16:53:44Z Indexed on 2010/05/24 6:21 UTC
Read the original article Hit count: 238

An application I am working on reads information from files to populate a database. Some of the characters in the files are non-English, for example accented French characters.

The application is working fine in Windows but on our Solaris machine it is failing to recognise the special characters and is throwing an exception. For example when it encounters the accented e in "Gérer" it says :-

      Encountered: "\u0161" (353), after : "\'G\u00c3\u00a9rer les mod\u00c3"

(an exception which is thrown from our application)

I suspect that in order to stop this from happening I need to change the file.encoding property of the JVM. I tried to do this via System.setProperty() but it has not stopped the error from occurring.

Are there any suggestions for what I could do? I was thinking about setting the basic locale of the solaris platform in /etc/default/init to be UTF-8. Does anyone think this might help?

Any thoughts are much appreciated.

© Stack Overflow or respective owner

Related posts about java

Related posts about character-encoding