commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthias Bräuer <>
Subject Re: [Configuration] Problems reading Chinese text from an XMLConfiguration - Problem solved, thanks
Date Mon, 05 Sep 2005 09:01:40 GMT

> XML allows you to specify the encoding of the document, otherwise it 
> defaults to ISO-8859-1.
> [...] change it to <?xml encoding="UTF-8"?> if that isn't in the xml 
> document or the very first item, add it.

The encoding was correctly specified in the XML document. The reason for 
the error was indeed the bug Oliver pointed at:

> Note also that in configuration 1.1 final there was a bug that the 
> encoding was not always taken into account 
> ( So you 
> might want to check out the newest version from SVN. 

With the current version of Commons Configuration (1.2 dev) the encoding 
is recognized correctly and all Chinese characters remain untouched. 
This works even without specifiying the encoding beforehand (by calling 
setEncoding() ). However, before saving a configuration to another XML 
document the setEncoding() method still has to be called or the file 
will not be stored in the desired UTF-8.

Thanks alot for helping me so quickly.

Best wishes,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message