Solution based on java 6 (but it should apply for all version since 1.0)
So you setup your propeties like:
paths.secret.loverslist= C:\\mySecrets\\loverlist.txt
or something similar but when your application load/save properties and start use them then you discover result are crap and produce bunch of weird characters instead and cause program to work in akward way (Exceptions, JVM crash and other fireworks) and you think:
WTF java ,what's wrong with you ?
most problems are caused by encoding issues* because you need to knows that
java.util.Properties loads properties files using the ISO-8859-1 encoding so your file need to be saved in that format or shit hit the fan.
in rest cases are typo error like path issue (like using \ instead of \\) , so do double check or ask somebody to check for you.
and remeber properties file need be saved using ISO-8859-1 encoding !!!!
(Source: http://download.oracle.com/javase/6/docs/api/java/util/Properties.html )
* from my experience 66% encoding , 33% typo error, 1% others
DOMINIK SYMONOWICZ's blogs - FOREVER HUNGRY of knowledge, sarcasm, smiling, music, dancing, and food ...lots of food. This IT blog is a collection of notes with a simple solution with an explanation, added documentation, sarcastic comment and weird example. I also write about a lesson learnt from my mistakes. A non-it blog can be found here: Dominik Symonowicz's non-IT blog and website
Showing posts with label encoding. Show all posts
Showing posts with label encoding. Show all posts
Subscribe to:
Posts (Atom)