Re: Speaking of Plane 1 characters...

From: John Cowan (
Date: Mon Nov 11 2002 - 15:17:18 EST

  • Next message: John Hudson: "Re: Speaking of Plane 1 characters..."

    John Hudson scripsit:
    > One of the tools I use for building fonts requires that codepoints for
    > Plane 1 characters be expressed as surrogate pairs, rather than as scalar
    > values. I'm hoping this will change on the next release, since the scalar
    > I need to figure
    > out the easiest way to find the correct surrogate pair values for any given
    > scalar value.

    If you have access to any Windows box, you can use the Windows Calculator
    (Start/Programs/Accessories/Calculator). Choose View/Scientific and
    click on the Hex radio button. Then enter your 5-digit Unicode scalar value.
    (You must type hex digits in lower case.) To get the high surrogate, type:

            - 1 0 0 0 0 = / 4 0 0 + d 8 0 0 =

    To get the low surrogate, enter the scalar value again and type:

            - 1 0 0 0 0 = % 4 0 0 + d c 0 0 =

    You can also use the mouse, in which case "%" above represents the MOD key.

    On *ix systems, use the "bc" command; type "obase=16" and "ibase=16".
    For this program, you must use capital letters for the hex digits.
    To get the high surrogate, type "(xxxxx-10000)/400+DC00" for the high
    surrogate ("xxxxx" is the scalar value); to get the low surrogate,
    type "(xxxxx-10000)%400+DC00".

    On the Macintosh, I have no clue.

    John Cowan                         
            "You need a change: try Canada"  "You need a change: try China"
                    --fortune cookies opened by a couple that I know

    This archive was generated by hypermail 2.1.5 : Mon Nov 11 2002 - 15:49:28 EST