• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Could you hold this puppy for a sec? I need to adjust this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic