Re: Commit: string classes rearranged

From: Andrew Dunbar (hippietrail@yahoo.com)
Date: Fri Jan 03 2003 - 21:31:20 EST

  • Next message: Jordi Mas: "commit: fix for bug 2481"

     --- Dom Lachowicz <domlachowicz@yahoo.com> wrote: >
    > --- "j.m.maurer" <j.m.maurer@student.utwente.nl>
    > wrote:
    > > Op vr 03-01-2003, om 22:17 schreef Dom Lachowicz:
    > > > I'll re-enable the UCS2 methods on the UCS4 and
    > > > UTF8 string classes and simply remove the UCS2
    > > > string class and other silly ucs2 functions.
    > >
    > > Great! That's all I need (and should be needed)
    >
    > Or, as Wlach and I discussed on IRC, since UCS2 is a
    > proper subset of UCS4, all you need to do is append
    > the chars to a UCS4String class by casting them to a
    > UCS4Char first:
    >
    > for (i=0;i<len;i++)
    > ucs4 += (UT_UCS4Char)ucs2[i];

    This is exactly right and I was going to mention it
    myself. Note that this illustrates the difference
    between UCS-2 and UTF-16. This does not work with
    UTF-16 since values which represent the halves of
    surrogate pairs are illegal characters in UCS-4
    (and all other Unicode encodings).

    Andrew Dunbar.

    > Dom
    >
    > __________________________________________________
    > Do you Yahoo!?
    > Yahoo! Mail Plus - Powerful. Affordable. Sign up
    > now.
    > http://mailplus.yahoo.com

    =====
    http://linguaphile.sourceforge.net/cgi-bin/translator.pl http://www.abisource.com

    __________________________________________________
    Do You Yahoo!?
    Everything you'll ever need on one web page
    from News and Sport to Email and Music Charts
    http://uk.my.yahoo.com



    This archive was generated by hypermail 2.1.4 : Fri Jan 03 2003 - 21:34:50 EST