commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 34204] - [configuration] XMLConfiguration ignore a specific encoding in XML declaration
Date Sun, 25 Sep 2005 18:00:33 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34204>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34204





------- Additional Comments From oliver.heger@t-online.de  2005-09-25 20:00 -------
(In reply to comment #11)
> 
> How can I specify the encoding of a properties file in configuration factory
> config.xml? Or does it recognise the encoding automatically? (Well it's not like
> XML which can specify the encoding at the beginning of the XML document.)
> 

You can simply set an encoding attribute as demonstrated in the following example:

<configuration>
  <properties fileName="test.properties" encoding="UTF-8"/>
  <properties fileName="test.properties.xml"/>
  <xml fileName="test.xml" encoding="ISO-8859-1"/>
</configuration>

(This works because the configuration definition files are read by
Commons-Digester, which maps attributes to bean properties. So in this case the
setEncoding() method of AbstractFileConfiguration will be called. This works for
other properties, too.)

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message