[Qt-interest] Does Qt support Unicode 5.1?

Shaun Cummins cumminss at gmail.com
Thu Mar 5 23:33:24 CET 2009


Thanks! That makes perfect sense. So when encoding with UTF-16 a 20 bit
value (a character outside of the BMP) is split into two 10 bit values and
placed into a reserved section that only takes about 3% of the entire range
of the BMP.

The only thing that doesn't make sense to me is why Qt doesn't do this
automatically. It seems like the code in QChar should be able to handle this
without needing to explicitly do the work myself (by simply checking that a
value is not within the BMP and doing the necessary adjustments you do in
your code--especially since they already have utility functions to take the
low and high surrogates of a ucs4 value). I was confused because there are
constructors for QChar that take integers, another that takes unsigned
integers and other that take shorts or unsigned shorts. Since they made an
explicit constructor for integers I presumed that they could handle values
greater than 0xFFFF correctly.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090305/a4d70db8/attachment.html 


More information about the Qt-interest-old mailing list