Re: uuuuu = wwww + 1 means ?

From: Tony Graham (tgraham@mulberrytech.com)
Date: Wed May 03 2000 - 12:39:41 EDT

At 2 May 2000 07:32 -0800, James E. Agenbroad wrote:
> In table 3-1 on UTF-8 bit distribution a note about conversion of
> surrogate pairs says: "Where uuuuu = wwww + 1 (to account for addition of
> 10000(16) as in Section 3.7, Surrogates)." I would appreciate some help
> with this. Does it mean: Always add one to the binary value of wwww; if
> wwww was 1111, uuuuu becomes 10000, otherwise uuuuu becomes 0 followed by
> the sum of wwww +1. For example, if wwww were 1010, uuuuu becomes 01011.

Yes. The first bit of uuuuu is 0 unless wwww is 1111 (since 1111 + 1 =
10000).

> Some alternatives: 1. If wwww is 1111 make uuuuu = 10000; add 1 only
> if wwww = 1111; otherwise precede wwww by zero.

No, otherwise when wwww = 0000, uuuuu = 00000, and you're addressing
the BMP.

> 2. To create uuuuu always
> insert a 1 before the value of wwww.

No, otherwise when wwww = 0001, uuuu = 10001, and you're addressing
Plane 17 (and higher for higher values of wwww).

> 3. To create uuuuu always insert a 1
> after the value of wwww.

No, otherwise you're addressing the odd-numbered Planes between 1 and
31. (When wwww = 0000, uuuuu = 00001, and when wwww = 1111, uuuuu =
11111.)

> after the value of wwww. My uncertainty is due to understanding that
> uuuuu should always be one bit longer than wwww, but that adding 1 to wwww
> will only increase its length when the value of wwww is 1111.

The first (a.k.a. "most significant") bit of uuuuu is 0 unless the
result of wwww + 1 is the five-bit value 10000.

Regards,

Tony Graham
======================================================================
Tony Graham mailto:tgraham@mulberrytech.com
Mulberry Technologies, Inc. http://www.mulberrytech.com
17 West Jefferson Street Direct Phone: 301/315-9632
Suite 207 Phone: 301/315-9631
Rockville, MD 20850 Fax: 301/315-8285
----------------------------------------------------------------------
Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

This archive was generated by hypermail 2.1.2 : Tue Jul 10 2001 - 17:21:02 EDT