summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2015-05-15 10:59:54 -0600
committerKarl Williamson <khw@cpan.org>2015-09-04 10:21:17 -0600
commita62b247b9f3d5cc6214f83defea2e06d12398275 (patch)
treeec2bd2e98a8464e9160031756326688ac8c7b98a /handy.h
parent635e76f560b3b3ca075aa2cb5d6d661601968e04 (diff)
downloadperl-a62b247b9f3d5cc6214f83defea2e06d12398275.tar.gz
Add macro for converting Latin1 to UTF-8, and use it
This adds a macro that converts a code point in the ASCII 128-255 range to UTF-8, and changes existing code to use it when the range is known to be restricted to this one, rather than the previous macro which accepted a wider range (any code point representable by 2 bytes), but had an extra test on EBCDIC platforms, hence was larger than necessary and slightly slower.
Diffstat (limited to 'handy.h')
-rw-r--r--handy.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/handy.h b/handy.h
index 76dddc0a66..c3fd77d456 100644
--- a/handy.h
+++ b/handy.h
@@ -1579,7 +1579,7 @@ END_EXTERN_C
? _generic_isCC(*(p), classnum) \
: (UTF8_IS_DOWNGRADEABLE_START(*(p))) \
? _generic_isCC( \
- TWO_BYTE_UTF8_TO_NATIVE(*(p), \
+ EIGHT_BIT_UTF8_TO_NATIVE(*(p), \
*((p)+1 )), \
classnum) \
: utf8)
@@ -1665,7 +1665,7 @@ END_EXTERN_C
(UTF8_IS_INVARIANT(*(p)) \
? macro(*(p)) \
: (UTF8_IS_DOWNGRADEABLE_START(*(p))) \
- ? macro(TWO_BYTE_UTF8_TO_NATIVE(*(p), *((p)+1))) \
+ ? macro(EIGHT_BIT_UTF8_TO_NATIVE(*(p), *((p)+1)))\
: utf8)
#define _generic_LC_swash_utf8(macro, classnum, p) \