• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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

 
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
 
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • 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.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic