summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2010-11-15 10:27:02 -0700
committerFather Chrysostomos <sprout@cpan.org>2010-11-22 13:32:54 -0800
commit356979f4a7d780fd67a92a9ca6c8659bd12e7168 (patch)
tree7eb4378e2bae8870a9b01a4d52de33b44f8d065b /utf8.c
parent2950f2a73354102f32ec0556ad8d0ab46743b17a (diff)
downloadperl-356979f4a7d780fd67a92a9ca6c8659bd12e7168.tar.gz
pp.c, utf8.c: Convert to use TWO_BYTE_UTF8_TO_UNI
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/utf8.c b/utf8.c
index 019d49fbac..a818b3e0ba 100644
--- a/utf8.c
+++ b/utf8.c
@@ -836,8 +836,7 @@ Perl_bytes_cmp_utf8(pTHX_ const U8 *b, STRLEN blen, const U8 *u, STRLEN ulen)
if (u < uend) {
U8 c1 = *u++;
if (UTF8_IS_CONTINUATION(c1)) {
- c = UTF8_ACCUMULATE(NATIVE_TO_UTF(c), c1);
- c = ASCII_TO_NATIVE(c);
+ c = UNI_TO_NATIVE(TWO_BYTE_UTF8_TO_UNI(c, c1));
} else {
Perl_ck_warner_d(aTHX_ packWARN(WARN_UTF8),
"Malformed UTF-8 character "
@@ -966,8 +965,7 @@ Perl_bytes_from_utf8(pTHX_ const U8 *s, STRLEN *len, bool *is_utf8)
U8 c = *s++;
if (!UTF8_IS_INVARIANT(c)) {
/* Then it is two-byte encoded */
- c = UTF8_ACCUMULATE(NATIVE_TO_UTF(c), *s++);
- c = ASCII_TO_NATIVE(c);
+ c = UNI_TO_NATIVE(TWO_BYTE_UTF8_TO_UNI(c, *s++));
}
*d++ = c;
}