The last week I've been trying to figure out why some stream decoding my newly adopted application is doing was giving me some major encoding problems. Finally I figured out that the problem was that the JARs/WAR being built with Ant and deployed to the server were being compiled with the javac task using the encoding UTF-8 instead of the system default of CP1252.
This seems to be caused mainly by having many hard coded strings/chars for these special characters.
This was easily resolved by either of the following steps:
- changing the encoding for the eclipse project to be UTF-8 to match the byte code on the server
- setting the encoding for the javac task to be CP1252 to build the WAR file to match the client byte code
- and strangely enough just running Ant from the command prompt without designating any encoding.
So why is Ant in Eclipse changing to UTF-8? Is this configurable? Where do I configure it?
System
- Windows XP
- Eclipse 3.5
- Ant 1.7.1
- Java 1.6.0_11