This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant copy task corrupts UTF-8 symbols Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant copy task corrupts UTF-8 symbols" Watch "Ant copy task corrupts UTF-8 symbols" New topic
Author

Ant copy task corrupts UTF-8 symbols

Jana Pejic
Greenhorn

Joined: May 22, 2013
Posts: 1
I have .properties files with translations in Arabic, Chinese and other UTF-8 languages. I am using them to replace strings in an html file. However, when I start the copy task, it completely corrupts the symbols and I get something like this: المزادات

Any idea what's causing this and how I can fix it?

I am using Eclipse on Windows 7.

build.xml:
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1924
    
    7

A standard properties file (non-XML variant) is not expected to use UTF-8 encoding. You should be safe with ISO 8859-1 encoding as long as you use the appropriate Unicode escape sequences to replace the diacritics. See the Properties API documentation and the JLS for more information.


Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Ant copy task corrupts UTF-8 symbols
 
jQuery in Action, 3rd edition