In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/1be62ab994fa349db4cbecfda4ab8309b68c5361?hp=133e1f55118a8892ad5b9433ec99dd7a95c61dbc>
- Log ----------------------------------------------------------------- commit 1be62ab994fa349db4cbecfda4ab8309b68c5361 Author: Karl Williamson <k...@cpan.org> Date: Wed Aug 9 14:42:32 2017 -0600 utf8.c: EBCDIC fix Commit d819dc506b9fbd0d9bb316e42ca5bbefdd5f1d77 did not fully work. I switched the wrong thing that should have been in native vs Unicode/Latin1, and forgot to update the test file. Hopefully this is correct. ----------------------------------------------------------------------- Summary of changes: ext/XS-APItest/t/utf8_warn_base.pl | 5 ++++- utf8.c | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ext/XS-APItest/t/utf8_warn_base.pl b/ext/XS-APItest/t/utf8_warn_base.pl index 0f781c4002..91de8a8711 100644 --- a/ext/XS-APItest/t/utf8_warn_base.pl +++ b/ext/XS-APItest/t/utf8_warn_base.pl @@ -1087,7 +1087,10 @@ foreach my $test (@tests) { $correct_bytes_for_overlong = display_bytes_no_quotes($bytes); } - my $prefix = ($allowed_uv > 0x10FFFF) ? "0x" : "U+"; + my $prefix = ( $allowed_uv > 0x10FFFF + || ! isASCII && $allowed_uv < 256) + ? "0x" + : "U+"; push @expected_malformation_warnings, qr/\QMalformed UTF-8 character: $wrong_bytes\E \Q (overlong; instead use\E diff --git a/utf8.c b/utf8.c index c24baeb2f2..d6ff21ab08 100644 --- a/utf8.c +++ b/utf8.c @@ -1875,8 +1875,8 @@ Perl_utf8n_to_uvchr_error(pTHX_ const U8 *s, } else { U8 tmpbuf[UTF8_MAXBYTES+1]; - const U8 * const e = uvchr_to_utf8_flags(tmpbuf, - uv, 0); + const U8 * const e = uvoffuni_to_utf8_flags(tmpbuf, + uv, 0); /* Don't use U+ for non-Unicode code points, which * includes those in the Latin1 range */ const char * preface = ( uv > PERL_UNICODE_MAX @@ -1895,7 +1895,7 @@ Perl_utf8n_to_uvchr_error(pTHX_ const U8 *s, preface, ((uv < 256) ? 2 : 4), /* Field width of 2 for small code points */ - uv); + UNI_TO_NATIVE(uv)); } } } -- Perl5 Master Repository