std.stringbuffer

Janice Caron caron800 at googlemail.com
Wed Apr 30 08:06:01 PDT 2008


2008/4/30 terranium <spam at here.lot>:
> Janice Caron Wrote:
>
>  > You cannot uppercase in place, because for any given dchar, c, the
>  > number of UTF-8 bytes required to express c may be different from the
>  > number of UTF-8 bytes required to express toupper(c).
>
>  really?

Yes really.

    toUpper( '\u2C65' ) == '\u023A'
    toLower( '\u023A' ) == '\u2C65'

'\u023A' requires two bytes in UTF-8
'\u2C65' requires three bytes in UTF-8

Not a problem in UTF-16, of course.



More information about the Digitalmars-d mailing list