[Qt-interest] How to compress QString

Jan Kundrát jkt at gentoo.org
Thu Apr 16 16:58:51 CEST 2009


Oliver.Knoll at comit.ch wrote:
> How is UTF-8 more stable and better documented than UTF-16? I thought
> the range of Unicode characters is pretty well-defined? Or am I
> missing something here?

By the time I wrote that mail, I wasn't aware of the fact that Qt
declares that it uses UTF-16 for QStrings internally. If there was no
such guarantee, you'd have problems when touching QString's char*
returned by data().

However, I'm not sure if the size of the str.utf16() is really
str.size() * sizeof(ushort) -- what happens if there are surrogate pairs
in the string? Will they be reflected in QString's size()?

Cheers,
-jkt

-- 
cd /local/pub && more beer > /dev/mouth

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090416/7fa12bb3/attachment.bin 


More information about the Qt-interest-old mailing list