commons-user mailing list archives

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

> 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 
> (http://issues.apache.org/bugzilla/show_bug.cgi?id=34204). 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,
Matthias


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message