[Qt-interest] Does Qt support Unicode 5.1?

Thiago Macieira thiago.macieira at trolltech.com
Fri Mar 6 07:46:20 CET 2009


Shaun Cummins wrote:
>I agree with Thiago. The only difference I can see is if you gave junk
>values greater than the range of the Unicode standard to the
>highSurrogate() function you would get different output than you would
>with the HighSurrogate() function and I usually go by the axiom of
>junk in junk out and don't try to condition bad data to fit within the
>valid range. The Unicode standard is future-proof in this regard in
>that they have promised to never add more characters than will fit
>within the current number of available planes so any character outside
>of this is guaranteed to be invalid now and in the future.

The only acceptable behaviour when passed a character outside the valid 
Unicode range is to fail. There's no valid return value.

Since both functions return "ushort", there's no room for "invalid return 
value". So the only alternatives are to throw an exception or abort the 
program.

Or do like both solutions do: GIGO (garbage in, garbage out)
-- 
Thiago Macieira - thiago.macieira (AT) nokia.com
  Senior Product Manager - Nokia, Qt Software
      Sandakerveien 116, NO-0402 Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090305/aac9fabc/attachment.bin 


More information about the Qt-interest-old mailing list