diff options
author | Nicholas Clark <nick@ccl4.org> | 2021-05-13 10:15:28 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2021-05-22 08:22:26 +0000 |
commit | d30553598b9a36dc7e48770337611be88403d643 (patch) | |
tree | bf54e83123f7674a886ff1623ed05f480fe0ba25 /dist/Data-Dumper/t | |
parent | 22d88af0e3e04dca72dcd494a6298431e57aeae0 (diff) | |
download | perl-d30553598b9a36dc7e48770337611be88403d643.tar.gz |
Rework Data::Dumper Unicode-in-qr support.
This approach (and this commit message) are based on Aaron Crane's original
in GH #18771. However, we leave the pure-Perl Dump unchanged (which means
changing the tests somewhat), and need to handle one more corner case
(\x{...} escaping a Unicode character that follows a backslash).
The previous approach was to upgrade the output to the internal UTF-8
encoding when dumping a regex containing supra-Latin-1 characters. That
has the disadvantage that nothing else generates wide characters in the
output, or even knows that the output might be upgraded.
A better approach, and one that's more consistent with the one taken for
string literals, is to use `\x{…}` notation where needed.
Closes #18764
Diffstat (limited to 'dist/Data-Dumper/t')
-rw-r--r-- | dist/Data-Dumper/t/dumper.t | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/dist/Data-Dumper/t/dumper.t b/dist/Data-Dumper/t/dumper.t index af8c10308a..f05449e849 100644 --- a/dist/Data-Dumper/t/dumper.t +++ b/dist/Data-Dumper/t/dumper.t @@ -1734,9 +1734,6 @@ EOW TEST qq(Data::Dumper->Dump([ [qq/\x{41f}/, qr/\x{8b80}/, qr/\x{41f}/, qr/\x{e4}/, "\xE4"] ])), "string with Unicode + regexp with Unicode"; - SKIP_TEST "skipped, pending fix for github #18764"; - last; - $WANT =~ s/'\xE4'/"\\x{e4}"/; $WANT =~ s<([^\0-\177])> <sprintf '\\x{%x}', ord $1>ge; TEST qq(Data::Dumper->Dumpxs([ [qq/\x{41f}/, qr/\x{8b80}/, qr/\x{41f}/, qr/\x{e4}/, "\xE4"] ])), @@ -1797,9 +1794,6 @@ EOW TEST qq(Data::Dumper->Dump([ [ '\x{2e18}', qr! \x{203d}/ !, qr! \\\x{203d}/ !, qr! \\\x{203d}$bs:/ !, "\xa3"] ])), "github #18614, github #18764, perl #58608 corner cases"; - SKIP_TEST "skipped, pending fix for github #18764"; - last; - $WANT =~ s/'\x{A3}'/"\\x{a3}"/; $WANT =~ s/\x{203D}/\\x{203d}/g; TEST qq(Data::Dumper->Dumpxs([ [ '\x{2e18}', qr! \x{203d}/ !, qr! \\\x{203d}/ !, qr! \\\x{203d}$bs:/ !, "\xa3"] ])), |