[Qt-interest] QString and UNICODE: size determination
Bob Hood
bhood2 at comcast.net
Thu Jul 9 16:27:40 CEST 2009
Many thanks to you both.
Girish Ramakrishnan wrote:
> Constantin Makshin wrote:
>> QString *always* stores Unicode characters, so the amount of memory used
>> by QString's contents is "str.size() * 2" or, what should be even better
>> (forward compatibility, etc.), "str.size() * sizeof(QChar)".
>
> sizeof(QChar) is the size of QChar object, which is not necessarily 2
> (but it should be on most compilers). I would suggest str.size() * 2
> instead.
Render me gone, |||
Bob ^(===)^
---------------------------------oOO--(_)--OOo---------------------------------
"If ya can't beat 'em, tariff 'em."
- /Harley-Davidson Motor Company/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090709/5d854118/attachment.html
More information about the Qt-interest-old
mailing list