On 08 Sep 2013, at 20:01, development-requ...@qt-project.org wrote:

> From: Konstantin Ritt <ritt...@gmail.com>
> Subject: Re: [Development] [Question] Implementation of XML character 
> validation
> Date: 8 Sep 2013 20:00:45 GMT+02:00
> To: "development@qt-project.org" <development@qt-project.org>
> 
> 
> [2]     Char     ::=     #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | 
> [#x10000-#x10FFFF]    /* any Unicode character, excluding the surrogate 
> blocks, FFFE, and FFFF. */
> in XML 1.0 is quite the same as
> [2] Char       ::= [#x1-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]        
> /* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. */
> [2a] RestrictedChar    ::= [#x1-#x8] | [#xB-#xC] | [#xE-#x1F] | [#x7F-#x84] | 
> [#x86-#x9F]
> in XML 1.1, except of [U+007F..U+0084] and [U+0086..U+009F], which are 
> prohibited now.

Is it prohibited or just "highly discouraged"? Where in XML1.0, characters 
below 0x0020 were simply not allowed (except for 0x0009, 0x000A and 0x000D), in 
XML1.1 they are called "highly discouraged" (it seems the constraints have been 
loosened a bit). How should "highly discouraged" be interpreted: should Qt 
allow them, or mark them as prohibited?

> 
> The code looks correct for XML 1.0, however I didn't find the surrogates 
> validation code neither in qxml*, neither in QUtfCodec-s. I'll probably write 
> some additional tests once have a time for that.

Correct, I didn't even notice this.

And what about?

bool QXmlUtils::isChar(const QChar c)
{
    return (c.unicode() >= 0x0020 && c.unicode() <= 0xD7FF)
           || c.unicode() == 0x0009
           || c.unicode() == 0x000A
           || c.unicode() == 0x000D
           || (c.unicode() >= 0xE000 && c.unicode() <= 0xFFFD);
}
Isn't this code missing the check 
c >= 0x10000 && c <= QChar::LastValidCodePoint ?


> You may want to raise a suggestion/feature request via 
> http://bugreports.qt-project.org/ about upgrading XML support in Qt up to 1.1
> 
> 
> Regards,
> Konstantin
> 
Regards,

Kurt
_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to