+ * Detect overlong encodings. We're looking for too many
+ * leading zeroes given our position in the character. If
+ * we find an overlong encoding, clear the current marker
+ * bit and set the bit below it. Overlong two-byte
+ * encodings are a special case, and are detected when we
+ * read their inital byte.
+ */
+ if ((charval & 0xffffffe0L) == 0x02000000L)
+ charval ^= 0x03000000L;
+ else if ((charval & 0xfffffff0L) == 0x00080000L)
+ charval ^= 0x000c0000L;
+ else if ((charval & 0xfffffff8L) == 0x00002000L)
+ charval ^= 0x00003000L;
+ else if ((charval & 0xfffffffcL) == 0x00000080L)
+ charval ^= 0x000000c0L;
+
+ /*