/* utf8.c
*
- * Copyright (c) 1998-2003, Larry Wall
+ * Copyright (C) 2000, 2001, 2002, 2003, by Larry Wall and others
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
continue;
}
if (uv >= 0xd800 && uv < 0xdbff) { /* surrogates */
- UV low = *p++;
+ UV low = (p[0] << 8) + p[1];
+ p += 2;
if (low < 0xdc00 || low >= 0xdfff)
Perl_croak(aTHX_ "Malformed UTF-16 surrogate");
uv = ((uv - 0xd800) << 10) + (low - 0xdc00) + 0x10000;