Search code examples
javaxamlsymbolskaxaml

Creating a ° in a xaml file


So, I'm making a xaml file using java. This is my line of code in java :

String newAnswer = e.getText().substring(0, 1) + "º" + e.getText().substring(2);

Now

"º" 

This part should, according to Google, create a degrees symbol in my xaml file, however when I open the output file in xaml I get this: º , if i remove the amp; part it is correct, but I'd like Kaxaml to stop adding that in the first place, if anyone knows how to achieve this, that'd be greatly appreciated.

This is how my xaml gets saved

Utilities.saveXml(d, "Scherm1.xaml");
Utilities:
 public static void saveXml(Document document, String fileName) throws IOException {
    FileWriter writer;
    XMLOutputter outputter;

    outputter = new XMLOutputter();
    outputter.setFormat(Format.getPrettyFormat());
    writer = new FileWriter(fileName);
    outputter.output(document, writer);
    writer.flush();
    writer.close();
}

Solution

  • try using

     + <TextBlock &#186;"/>