utf8.h: Add macro TWO_BYTE_UTF8_TO_UNI()
authorKarl Williamson <public@khwilliamson.com>
Mon, 15 Nov 2010 17:18:58 +0000 (10:18 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 22 Nov 2010 21:32:54 +0000 (13:32 -0800)
commit2950f2a73354102f32ec0556ad8d0ab46743b17a
treedeea42e6aec2d8140668c8c7ead38abe662de64b
parent9df205e24a206d67715d225f771fd6a02b9681bd
utf8.h: Add macro TWO_BYTE_UTF8_TO_UNI()

The code to do this isn't obvious, as it was wrong in 5 different places
in two different files (forgetting one or both of the required
conversions to UTF (which is a no-op except on EBCDIC machines, or it
would have been detected sooner.)

Some of that code depended on left shifting being truncated in a U8.
This adds UTF_START_MASK so it can work in a larger width variable.
utf8.h