This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

An UTF-8 Maven build with n ISO-8859-1 property files

 
hoppe slott
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone!

I'm struggling with the following problem:
1) production server has the following system default encoding : UTF-8
2) We want to use UTF-8, every file is stored as UTF-8 etc
3) But because of struts and the Java Properties class, our language resource files are stored as ISO-8859-1.
4) When running the maven build somehow all the files stored as ISO-8859-1 gets converted to UTF-8 in the build output

Unwanted result: æøå becomes gibberish
Possible, but unwanted solution: replace all æøå with unicode escape characters \uxxxx

Is it at all possible to tell maven to do the following:
1) do your usual stuff
2) BUT leave the storage format of the following files alone!

Hope someone out there can help. Google couldn't this time :-/

Regards,
Hoppeslott
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Hoppe,

Have you tried playing with the encoding settings in your POM?
 
hoppe slott
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solved it by using
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>native2ascii-maven-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>native2ascii</goal>
</goals>
<configuration>
<encoding>UTF-8</encoding>
<src><oursource></src>
<dest>target/native2ascii_tmp</dest>
<includes>**/*.properties</includes>
</configuration>
</execution>
</executions>
</plugin>

and then running the files through the filter.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic