summaryrefslogtreecommitdiff
path: root/hv.c
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 /hv.c
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 'hv.c')
-rw-r--r--hv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hv.c b/hv.c
index 9271901395..253cad9838 100644
--- a/hv.c
+++ b/hv.c
@@ -3223,7 +3223,7 @@ Perl_refcounted_he_fetch_pvn(pTHX_ const struct refcounted_he *chain,
}
else {
p++;
- *q = (char) TWO_BYTE_UTF8_TO_NATIVE(c, *p);
+ *q = (char) EIGHT_BIT_UTF8_TO_NATIVE(c, *p);
}
}
}
@@ -3399,7 +3399,7 @@ Perl_refcounted_he_new_pvn(pTHX_ struct refcounted_he *parent,
}
else {
p++;
- *q = (char) TWO_BYTE_UTF8_TO_NATIVE(c, *p);
+ *q = (char) EIGHT_BIT_UTF8_TO_NATIVE(c, *p);
}
}
}