Maven 2.x IDEA Plugin

iml file generation done in the platform encoding, not UTF-8

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.2
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

When *.iml files are generated, characters are apparently encoded in the platform default encoding. This is inconsistent with the XML declaration placed in these files, which say UTF-8. So the resulting project files don't load correctly when some of the pathnames contain non-ASCII characters.

I bet somewhere in the code you are doing just "new OutputStreamWriter(new FileOutputStream(...))" kind of things. Please change the code to use UTF-8.

Activity

Hide
Dennis Lundberg added a comment -

I found this code in the class IdeaXmlWriter, that is used to write all files for this plugin.

new FileWriter( file )

Would it be correct to change this to:

new OutputStreamWriter( new FileOutputStream( file ), "UTF-8" )

Can you provide a sample pom.xml file that I can use for testing?

Show
Dennis Lundberg added a comment - I found this code in the class IdeaXmlWriter, that is used to write all files for this plugin.
new FileWriter( file )
Would it be correct to change this to:
new OutputStreamWriter( new FileOutputStream( file ), "UTF-8" )
Can you provide a sample pom.xml file that I can use for testing?
Hide
Kohsuke Kawaguchi added a comment -

Yes. That's it. Thanks!

Show
Kohsuke Kawaguchi added a comment - Yes. That's it. Thanks!
Hide
Dennis Lundberg added a comment -

A new SNAPSHOT has been deployed with a fix for this. Please verify that it works.

Show
Dennis Lundberg added a comment - A new SNAPSHOT has been deployed with a fix for this. Please verify that it works.

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: