How to specify character encoding for Ant Task parameters in Java -
I am writing an ANT function in Java I
In my build.xml I specify the parameter I must be read from my Java class, which should be read from my Java class. When I use special characters such as German characters (O, Ü) in these parameters, problems arise. They appear in my Java function - Impressions (from within the system.out.print from eclipse).
All my files are encoded as UTF-8. And this is the declaration of my build.xml:
For the description of the work writing: I do it according to (especially 5 nested elements) I have nested elements in my work such as:
& lt; Parameter name = "test" value = "ÖÄÜtest" />
and a Java method:
public zero addConfiguredParameter (parameter prop) {System.out.println (prop.getValue ()); // print = test}
to read parameter values.
- Save UTF-8 as XML to your editor
- Check that characters are correctly encoded using hex editors
- Parsing of UTF-16 strings XML from UTF-8 by AMT
- There is little chance of a mistake here
- Transcoding encoding by
system.out
by UTF-16 string- Check that the encoding used
- The encoding of the bytes received by Eclipse Console in the UTF-16 string for display
- The encoding used by the console is
PrintStream
Encoded as UTF-8, you would expect the following encoded values in your XML file:
Graphf UTF-8 encoded bytes oc3 96cc 84 84c6c
- The encoding used by the console is