[ https://issues.apache.org/jira/browse/MRESOURCES-171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17158106#comment-17158106 ]
Aaron Digulla commented on MRESOURCES-171: ------------------------------------------ [~afloom] and others: The encoding of property files is defined by the Java TCK and the default *MUST BE ISO-8859-1.* UTF-8 or anything else IS NOT VALID. That's what this bug is about: *The Java standard* *says ISO-8859-1* (which is a bad choice IMHO but that's what it is). This is true for ALL JAVA versions from 1.0 to 11. A lot of people are suprised by this but there is really no way around it. [From the docs (again)|https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html]: {quote}the input/output stream is encoded in ISO 8859-1 character encoding. {quote} Note: this is not true when you use XML to serialize the properties, only for the old *.properties files. If you want UTF-8, I suggest you load/save as XML, that avoids a whole load of trouble plus has some nice features like nesting paths and comments everywhere. > ISO8859-1 properties files get changed into UTF-8 when filtered > --------------------------------------------------------------- > > Key: MRESOURCES-171 > URL: https://issues.apache.org/jira/browse/MRESOURCES-171 > Project: Maven Resources Plugin > Issue Type: Bug > Components: filtering > Reporter: Alex Collins > Priority: Minor > Attachments: filtering-bug.zip > > > Create: > src/main/resources/test.properties > And add a ISO8859-1 character that is not ASCII or UTF-8, do not use \uXXXX > formatting. > When adding this line: > <resource><directory>src/main/resources</directory><filtering>true</filtering></resource> > Expected: > ISO8859-1 encoded file in jar. > Actual: > UTF-8 encoded file in jar. > --- > If there are any property files (which can only be ISO8859-1) they appear to > be converted into UTF-8 in the jar. -- This message was sent by Atlassian Jira (v8.3.4#803005)