From 7ae54b83ee5a2592c85f68253d73dcfc43161de2 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Wed, 28 Sep 2016 20:42:30 -0600 Subject: 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. --- utf8.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'utf8.c') 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; } -- cgit v1.2.1