Issue Details (XML | Word | Printable)

Key: CONFIGURATION-345
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Oliver Heger
Reporter: Guillaume Darmont
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Configuration

PropertiesConfiguration does not use the default encoding to load files

Created: 03/Nov/08 10:45 AM   Updated: 22/Aug/09 07:36 PM
Return to search
Component/s: None
Affects Version/s: 1.5
Fix Version/s: 1.6

Time Tracking:
Not Specified

Environment: Win XP / Sun JVM 1.5.0_14

Resolution Date: 08/Nov/08 09:17 PM


 Description  « Hide
The piece of code
PropertiesConfiguration.java
// initialization block to set the encoding before loading the file in the constructors
    {
        setEncoding(DEFAULT_ENCODING);
    }

seems to set correctly the default encoding, but this block is called after "super()" in constructors.

So when using either PropertiesConfiguration(java.io.File file), PropertiesConfiguration(java.lang.String fileName) or PropertiesConfiguration(java.net.URL url), the super() statement is called, and it loads the file without the default encoding.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #712431 Sat Nov 08 21:05:23 UTC 2008 oheger CONFIGURATION-345: Ensure that "ISO-8859-1" is used as default encoding, even by the constructors of the super class.
Files Changed
MODIFY /commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestPropertiesConfiguration.java
MODIFY /commons/proper/configuration/trunk/xdocs/changes.xml
MODIFY /commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/PropertiesConfiguration.java

Repository Revision Date User Message
ASF #712432 Sat Nov 08 21:11:52 UTC 2008 oheger CONFIGURATION-345: Ensure that "ISO-8859-1" is used as default encoding, even by the constructors of the super class. Ported the fix to the configuration2 branch.
Files Changed
MODIFY /commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestPropertiesConfiguration.java
MODIFY /commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/PropertiesConfiguration.java
MODIFY /commons/proper/configuration/branches/configuration2_experimental/xdocs/changes.xml