[Kde-games-devel] Parsing and translating XML game-data

Burkhard Lehner Burkhard.Lehner at gmx.de
Fri Dec 1 10:48:20 CET 2006


Hi Ian,

2006/11/30, Ian Wadham <ianw2 at optusnet.com.au>:

> I can use QDomElement::text().toUtf8().  It gets back a "u"
> with umlaut in 2 bytes as expected, but I am not sure I get
> back all my whitespace and I certainly *lose* the format tags.
>

I don't think you will loose the format tags. They are simply ASCII
characters ('<', '>', '\'). The interpretation of them as rich text tags
takes place later, when the text is to be drawn on the screen. So it should
be fine to use toUtf8() if necessary.

Generally, if you read a UTF-8 string into a QString object str, str.toUtf8()
should in (nearly) every case return the original UTF-8 string. There are
only some unimportant special cases, when you store ASCII characters as 2
byte (which usually doesn't make sense).

Bye,
Burkhard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-games-devel/attachments/20061201/8a4c2729/attachment.html 


More information about the kde-games-devel mailing list