What is the right way to represent an XML data, when the datahas non-ascii characters. Below are the 2 options, which is the correct and valid one.
Option 1:
<?xml version="1.0" encoding="UTF-8"?>
<name>Doña</name>
Option 2:
<?xml version="1.0" encoding="UTF-8"?>
<name>Doña</name>
F1 is the unicode of ñ in UTF-8 in hexadecimal.
Basically they are both equivalent and correct. You could even opt for
ñ, which is the decimal Unicode codepoint.It depends mostly on what your tools need. If there is a step in your toolchain, where plain ASCII is desirable, use option 2. If people look at your XML in an editor, or file size is an issue, use option 1. Most XML evangelists nowadays tend to option 1 in most cases.
Note, that XML tools are free to transform between those representations. This means, you should never trust your XML to look one or the other way. You must support both options when processing XML input.