Decode XML Characters (numeric) in Strings
-
Hello,
i want to decode the following string Photo's to Photo's. Is there a function in qt5.4?
Greets
-
Hi,
what do you mean?
The two strings are the same. -
Damn it. Seems the Forum converted it. I meant this: <pre><code>Photo & # 0 3 9 ; s</code></pre>
P.S. How is the syntax for code or raw text?
-
Hi,
to read XML strings the suggested way is to use
QXmlStreamReader
.P.S. To write raw text you can include it in `<TEXT>`;
<pre><code>AAA ĵs</code></pre>
-
Sorry, i inserted the tags pre and code. The Forum says it supports Markdown. Apparently not. I have only the string
Photo's
and want to "convert" it to Photo's. -
If you aren't dealing with a complete XML document and don't want to use QXmlStreamReader and Writer you can just do
QString("My string with Photo's").replace("'", "'")
to replace the entity with the actual character.