Reply
Thread Tools
krk969's Avatar
Posts: 754 | Thanked: 630 times | Joined on Sep 2009 @ London
#1
Im trying to read xml files using QXMLStreamReader to read xml files having russian and other latin character sets.

when I use

QXmlStreamReader reader;

reader.text()
gets me a QStringRef which when displayed shows funny characters and not the actual latin string.

has anybody got any ideas how to go about this in QT ?

thanks
__________________
Developer of :
Buddy - budget/expense manager ( website )
Showtime - a telly channel listing viewer/reminder ( website )
Travelapp - london underground status/planner ( website )
Batlevel - desktop widget for battery level ( website )

“I hear and I forget. I see and I remember. I do and I understand.”
 
krk969's Avatar
Posts: 754 | Thanked: 630 times | Joined on Sep 2009 @ London
#2
for the benefit of others.

2 ways to go about this

1. You could read data from a QIODevice with QTextStream. Since text stream has a Unicode based buffer, you could pass the codified data to the xmlstream reader.

2. or do a funny looking thing like this, I did this
QString::fromUtf8(reader.text().toString().toAscii ().constData());
where reader is a QXmlStreamReader
__________________
Developer of :
Buddy - budget/expense manager ( website )
Showtime - a telly channel listing viewer/reminder ( website )
Travelapp - london underground status/planner ( website )
Batlevel - desktop widget for battery level ( website )

“I hear and I forget. I see and I remember. I do and I understand.”

Last edited by krk969; 2010-02-23 at 00:28.
 

The Following User Says Thank You to krk969 For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 23:34.