Thomas Scheffler wrote: > Am Montag, 20. Juli 2009 19:43:14 schrieb daniel.green: >> Upon the packaging of my war, I want to convert all .properties files to >> utf8. Can I do this with straight maven or will I need to run an ant task >> OR write my own plugin? > > If your .properties files should be read by the java.util.Properties class > please keep in mind that they HAVE to be encoded in "ISO 8859-1" a.k.a. > "latin1". > > see http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html > > "The load and store methods load and store properties in a simple line- > oriented format specified below. This format uses the ISO 8859-1 character > encoding. Characters that cannot be directly represented in this encoding > can > be written using Unicode escapes ; only a single 'u' character is allowed > in an escape sequence. The native2ascii tool can be used to convert > property files to and from other character encodings."
With JDK 6 this has changed, you may also use different encodings. However, keeping .property files in ISO-8859-1 is good practice and I am not astonished, that some tools take this for granted. - Jörg --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
