I haven been going crazy lately over encoding problems that occur when developing on a Windows machine and then deploying on a Linux production system. It has looked like whenever I don't explicitly use encodings in my code, I run into trouble. One should think that setting the file.encoding system property to the same values on both systems should do the trick - but nouu...
Okay, this is not a rant post, so the reason I am complaining is because I would like to express the joy of finally having found a solution. I'm happy! :)
Aparantly, setting the file.encoding on some Linux systems has no effect. The jre uses the function nl_langinfo() to discover the default encoding to use. This function is based on the LANG or LC_ALL environment variables. So, setting LANG=en_EN.utf-8 i can force my application to use UTF-8 as default encoding.
Also, it appears that Java 5 has this problem solved and uses the file.encoding system property correctly.
Atleast, now things are understandable.