*
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 Android Security Essentials Live Lessons this week in the Android 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: 1753
    
    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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Ant copy task corrupts UTF-8 symbols
 
Similar Threads
how can i choose the right encoding to read arabic
Mail Content problem for Arabic & Hebrew language
Arabic encoding
org.hibernate.exception.JDBCConnectionException: Cannot open connection
Write Arabic text into CSV file