[ https://issues.apache.org/jira/browse/MRESOURCES-171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17158089#comment-17158089 ]
Anders Hammar commented on MRESOURCES-171: ------------------------------------------ I very much like convention over configuration, so it would be nice if we just handled properties files (and other files like xml files) correctly without user configuration. But, we should also strive for backwards compatibility. So what I'm thinking is, does it make sense to change the encoding of a file during filtering? If we can figure out the encoding of the original file, shouldn't we use that encoding when writing the filtered (output) file and not use some configured value (that could be used a fall-back if not possible to decide)? I'm thinking about a solution similar to JEP 226 (as we should support Java 8 as well we can't use that impl). So, treat *.properties as UTF-8 but if we get a MalformedInputException or an UnmappableCharacterException we use ISO-8859-1. Something like that. > 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)