I'm writing an ANT task in Java.
In my build.xml I specify parameters, which should be read from my java class. Problems occur, when I use special characters, like german umlauts (Ö,Ä,Ü) in these parameters. In my java task they appear as ?-characters (using System.out.print from within eclipse).
All my files are encoded as UTF-8. and my build.xml has the corresponding declaration:
<?xml version="1.0" encoding="UTF-8" ?>
For the details of writing the task: I do it according to http://ant.apache.org/manual/develop.html (especially Point 5 nested elements). I have nested elements in my task like:
<parameter name="test" value="ÖÄÜtest"/>
and a java method:
public void addConfiguredParameter(Parameter prop) {
System.out.println(prop.getValue());
//prints ???test
}
to read the parameter values.