|
[
Permlink
| « Hide
]
Joerg Schaible added a comment - 03/Nov/08 11:05 AM
Well, Java does not really support a special encoding for a property file. According the spec http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#store(java.io.OutputStream,%20java.lang.String
That's exactly the point.
If I have an ISO-8859-1 properties file (as it must be) but the current JVM default encoding is UTF-8, the 3 constructors above will use UTF-8 since they call the load() method (via super(...)) before the block setEncoding(DEFAULT_ENCODING). I'm not used to work with initialization block so I checked the behavior using the debugger to understand why the "setEncoding(DEFAULT_ENCODING)" wasn't called before "load()". Hope this helps.
Oliver Heger made changes - 08/Nov/08 08:54 PM
A fix was applied in revision 712431 (and also ported to the configuration2 branch).
Hm, in "Effective Java" (http://java.sun.com/docs/books/effective/
Oliver Heger made changes - 08/Nov/08 09:17 PM
Oliver Heger made changes - 22/Aug/09 07:36 PM
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||