summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-02-07 19:53:38 -0700
committerKarl Williamson <public@khwilliamson.com>2013-08-29 09:55:49 -0600
commit8e7c6e7db4e68025440138ddf851a3b4a61d8b5a (patch)
treecc585d6898e4b3ec6457fc0e0b708bc949abf8fa /utf8.c
parentbc3632a8dfddf6cbc7c8232fd9d4d20f6c35dbd6 (diff)
downloadperl-8e7c6e7db4e68025440138ddf851a3b4a61d8b5a.tar.gz
Use byte domain EBCDIC/LATIN1 macro where appropriate
The macros like NATIVE_TO_UNI will work on EBCDIC, but operate on the whole Unicode range. In the locations affected by this commit, it is known that the domain is limited to a single byte, so the simpler ones whose names contain LATIN1 may be used. On ASCII platforms, all the macros are null, so there is no effective change.
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/utf8.c b/utf8.c
index d33ff4726c..1bdad1b3d2 100644
--- a/utf8.c
+++ b/utf8.c
@@ -1413,7 +1413,7 @@ Perl_utf16_to_utf8(pTHX_ U8* p, U8* d, I32 bytelen, I32 *newlen)
p += 2;
if (uv < 0x80) {
#ifdef EBCDIC
- *d++ = UNI_TO_NATIVE(uv);
+ *d++ = LATIN1_TO_NATIVE(uv);
#else
*d++ = (U8)uv;
#endif
@@ -4610,7 +4610,7 @@ Perl_foldEQ_utf8_flags(pTHX_ const char *s1, char **pe1, UV l1, bool u1, const c
to_utf8_fold(p1, foldbuf1, &n1);
}
else { /* Not utf8, get utf8 fold */
- to_uni_fold(NATIVE_TO_UNI(*p1), foldbuf1, &n1);
+ to_uni_fold(NATIVE_TO_LATIN1(*p1), foldbuf1, &n1);
}
f1 = foldbuf1;
}
@@ -4655,7 +4655,7 @@ Perl_foldEQ_utf8_flags(pTHX_ const char *s1, char **pe1, UV l1, bool u1, const c
to_utf8_fold(p2, foldbuf2, &n2);
}
else {
- to_uni_fold(NATIVE_TO_UNI(*p2), foldbuf2, &n2);
+ to_uni_fold(NATIVE_TO_LATIN1(*p2), foldbuf2, &n2);
}
f2 = foldbuf2;
}