summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2016-09-28 20:42:30 -0600
committerKarl Williamson <khw@cpan.org>2016-09-29 21:32:18 -0600
commit7ae54b83ee5a2592c85f68253d73dcfc43161de2 (patch)
treec1ad45376ad832aaa6044a9d87bf3100ad40b967 /utf8.c
parent5654fe3cb7747930ab73ec2386527c2d0007459f (diff)
downloadperl-7ae54b83ee5a2592c85f68253d73dcfc43161de2.tar.gz
utf8n_to_uvchr() Fix EBCDIC bug with overlongs
The comment removed in this commit was wrong, and so was the code it described. On EBCDIC platforms, there are malformations that need to be converted from Unicode to native. When I wrote that I wasn't thinking about overlongs, which can evaluate to any code point. The new tests in d566bd20c27a46aecd668d2f739b9515f46ac74f caught this.
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/utf8.c b/utf8.c
index 7f8df9d4af..8fb4bdd6e6 100644
--- a/utf8.c
+++ b/utf8.c
@@ -1046,9 +1046,7 @@ Perl_utf8n_to_uvchr(pTHX_ const U8 *s, STRLEN curlen, STRLEN *retlen, U32 flags)
}
if (sv) {
- outlier_ret = uv; /* Note we don't bother to convert to native,
- as all the outlier code points are the same
- in both ASCII and EBCDIC */
+ outlier_ret = UNI_TO_NATIVE(uv);
goto do_warn;
}