[Development] [Question] Implementation of XML character validation

Kurt Pattyn pattyn.kurt at gmail.com
Sun Sep 8 23:05:49 CEST 2013


Hi Konstantin,

that is exactly what I did.
From the Qt5 documentation:
> The QChar class provides a 16-bit Unicode character.
> In Qt, Unicode characters are 16-bit entities without any markup or structure. This class represents such an entity. It is lightweight, so it can be used everywhere. Most compilers treat it like a unsigned short.


There is no mention of UTF-16. Furthermore, I would expect to method unicode(), to return the UCS-4 representation:
> ushort QChar::unicode() const
> Returns the numeric Unicode value of the QChar.

But, it doesn't return the unicode v6.2 value, as that can be 32-bit; I know. It gives me the impression that QChar is based on an old Unicode standard.

Furthermore (again from the documentation):

> Qt 5.0 uses and fully supports version 6.2 of the Unicode standard.


At least, I think this is confusing.

So, either the documentation of QChar should at least indicate that it is encoded in UTF-16, which I doubt (because then QChar should have place for 2 16-bit values), or QChar should be adapted to conform to the statement that Qt5.0 is Unicode 6.2 compliant, or it should be indicated that QChar conforms to an older standard.

So, I was just wondering how QChar fits within the Unicode 6.2 standard? Reading the docs doesn't clarify much.

Kurt

On 08 Sep 2013, at 22:43, Konstantin Ritt <ritt.ks at gmail.com> wrote:

> 
> Plz read the docs.
> 
> Regards,
> Konstantin
> 
> 
> 2013/9/8 Kurt Pattyn <pattyn.kurt at gmail.com>
>> On 08 Sep 2013, at 20:43, Thiago Macieira <thiago.macieira at intel.com> wrote:
>> 
>> > On domingo, 8 de setembro de 2013 20:36:39, Kurt Pattyn wrote:
>> >
>> > It's limited by the size of QChar. It cannot contain 0x10000.
>> >
>> Isn't it supposed that a QChar contains a Unicode character (which is 32-bit in size)?
>> 
>> Regards,
>> Kurt
>> _______________________________________________
>> Development mailing list
>> Development at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/development
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130908/5b85103f/attachment.html>


More information about the Development mailing list