Parsing texts from XML file with QXmlStreamReader, '\n' replaced with '\\n'

246 Views Asked by At

I am parsing a xml file with QXmlStreamReader. This XML is like this:

<?xml version="1.0" encoding="UTF-8"?>
<LangDef langCode="0809">
    <LangID ID="0x0100" Text="Foo"/>
    <LangID ID="0x0101" Text="Foo \n Bar."/>
</LangDef>

The problem I have is that, when doing

text = attribute.value().toString().toStdString();

the value of text results in "Foo \\n Bar.". What should I do to make it write "Foo \n Bar."?

0

There are 0 best solutions below