From: Doug Ewell (dewell@adelphia.net)
Date: Tue Nov 12 2002 - 11:26:09 EST
Dominikus Scherkl <Dominikus dot Scherkl at glueckkanja dot com> wrote:
> utf16high = 0xD7C0 + (utf32 >> 10);
> utf16low = 0xDC00 + (utf32 & 1023);
>
> this is very easy to invert:
>
> utf32 = ((utf16high - 0xD7C0) <<10) + (utf16low & 1023);
This is good, but I'd write hexadecimal 0x3FF instead of decimal 1023,
as it shows the purpose of the bitmask a little more clearly.
(Apologies to Karl Pentzlin, if he is still on this list.)
-Doug Ewell
Fullerton, California
This archive was generated by hypermail 2.1.5 : Tue Nov 12 2002 - 12:12:16 EST