[ 
https://jira.codehaus.org/browse/MRESOURCES-171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=315324#comment-315324
 ] 
Alex Collins commented on MRESOURCES-171:
-----------------------------------------

Ah. I have choose a confusing example. My properties files are in ISO-8859-1 
(as they cannot be anything else, e.g. 
http://stackoverflow.com/questions/4659929/how-to-use-utf-8-in-resource-properties-with-resourcebundle,
 side-note: spot  the hacky solution suggested further down the page - yuk). If 
I converted them to UTF-8, they would be invalid. But this is perhaps a red 
herring. I'm not reporting that it's failing to make a special case for 
properties files.

Firstly, I'm saying is if you set the source encoding then when they are 
filtered, they are converted ***from ISO-8859-1*** into UTF-8. But I've set the 
source encoding as UTF-8! It shouldn't do any conversion at all, regardless of 
the fact they're in the wrong encoding. It's directly contravening the 
configuration. They should be not be converted! I have told the plugin that 
they are already in UTF-8, it should go "OK the file is in UTF-8". Not "it 
looks odd, I'll do some silent and un-requested conversion for them".

Additionally, the "source encoding" should only affect the treatment of source 
files, but it appears to affect the treatment of the "target files". If a 
properties file is going into a jar, it MUST be ISO-8599-1!!! But the plugin 
knowingly causes a faulty jar file. Perhaps Maven's lacking a 
project.build.targetEncoding property?
 
If you need to convince yourself, try creating a properties file with a 
sequence of non-ASCII characters that is valid in both UTF-8 ISO-8859-1 (if 
this is possible, which it might not be).
                
> ISO8859-1 properties files get changed into UTF-8 when filtered
> ---------------------------------------------------------------
>
>                 Key: MRESOURCES-171
>                 URL: https://jira.codehaus.org/browse/MRESOURCES-171
>             Project: Maven 2.x 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to