summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/_charnames.pm25
-rw-r--r--lib/charnames.pm2
-rw-r--r--lib/charnames.t22
-rw-r--r--lib/unicore/mktables12
-rw-r--r--pod/perldelta.pod8
5 files changed, 39 insertions, 30 deletions
diff --git a/lib/_charnames.pm b/lib/_charnames.pm
index 62ee39560d..5431d0fe6d 100644
--- a/lib/_charnames.pm
+++ b/lib/_charnames.pm
@@ -7,7 +7,7 @@ package _charnames;
use strict;
use warnings;
use File::Spec;
-our $VERSION = '1.31';
+our $VERSION = '1.32';
use unicore::Name; # mktables-generated algorithmically-defined names
use bytes (); # for $bytes::hint_bits
@@ -77,11 +77,8 @@ my %system_aliases = (
#my %loose_system_aliases = (
#);
-my %deprecated_aliases = (
- # Use of these gives deprecated message.
- # Unicode 6.0 co-opted this for U+1F514, so deprecate it for now.
- 'BELL' => pack("U", 0x07),
-);
+#my %deprecated_aliases;
+#$deprecated_aliases{'BELL'} = pack("U", 0x07) if $^V lt v5.17.0;
#my %loose_deprecated_aliases = (
#);
@@ -320,14 +317,14 @@ sub lookup_name ($$$) {
# elsif ($loose && exists $loose_system_aliases{$lookup_name}) {
# $utf8 = $loose_system_aliases{$lookup_name};
# }
- if (exists $deprecated_aliases{$lookup_name}) {
- require warnings;
- warnings::warnif('deprecated',
- "Unicode character name \"$name\" is deprecated, use \""
- . viacode(ord $deprecated_aliases{$lookup_name})
- . "\" instead");
- $utf8 = $deprecated_aliases{$lookup_name};
- }
+# if (exists $deprecated_aliases{$lookup_name}) {
+# require warnings;
+# warnings::warnif('deprecated',
+# "Unicode character name \"$name\" is deprecated, use \""
+# . viacode(ord $deprecated_aliases{$lookup_name})
+# . "\" instead");
+# $utf8 = $deprecated_aliases{$lookup_name};
+# }
# There are currently no entries in this hash, so don't waste time looking
# for them. But the code is retained for the unlikely possibility that
# some will be added in the future.
diff --git a/lib/charnames.pm b/lib/charnames.pm
index 495c30342f..bef3e1a3e9 100644
--- a/lib/charnames.pm
+++ b/lib/charnames.pm
@@ -1,7 +1,7 @@
package charnames;
use strict;
use warnings;
-our $VERSION = '1.30';
+our $VERSION = '1.32';
use unicore::Name; # mktables-generated algorithmically-defined names
use _charnames (); # The submodule for this where most of the work gets done
diff --git a/lib/charnames.t b/lib/charnames.t
index 6c2b54d017..ff94a82d26 100644
--- a/lib/charnames.t
+++ b/lib/charnames.t
@@ -295,11 +295,11 @@ is("\N{BOM}", chr(0xFEFF), 'Verify "\N{BOM}" is correct');
my $ok = ! grep { /"HORIZONTAL TABULATION" is deprecated.*"CHARACTER TABULATION"/ } @WARN;
ok($ok, '... and doesnt give deprecated warning');
- # XXX These tests should be changed for 5.16, when we convert BELL to the
- # Unicode version.
- is("\N{BELL}", "\a", 'Verify "\N{BELL}" eq "\a"');
- my $ok = grep { /"BELL" is deprecated.*"ALERT"/ } @WARN;
- ok($ok, '... and that gives correct deprecated warning');
+ if ($^V lt v5.17.0) {
+ is("\N{BELL}", "\a", 'Verify "\N{BELL}" eq "\a"');
+ my $ok = grep { /"BELL" is deprecated.*"ALERT"/ } @WARN;
+ ok($ok, '... and that gives correct deprecated warning');
+ }
no warnings 'deprecated';
@@ -365,7 +365,7 @@ is(charnames::viacode("U+00000000000FEED"), "ARABIC LETTER WAW ISOLATED FORM", '
is("\N{EOT}", "\N{END OF TRANSMISSION}", 'Verify "\N{EOT}" eq "\N{END OF TRANSMISSION}"');
is("\N{ENQ}", "\N{ENQUIRY}", 'Verify "\N{ENQ}" eq "\N{ENQUIRY}"');
is("\N{ACK}", "\N{ACKNOWLEDGE}", 'Verify "\N{ACK}" eq "\N{ACKNOWLEDGE}"');
- is("\N{BEL}", "\N{BELL}", 'Verify "\N{BEL}" eq "\N{BELL}"');
+ is("\N{BEL}", "\N{BELL}", 'Verify "\N{BEL}" eq "\N{BELL}"') if $^V lt v5.17.0;
is("\N{BS}", "\N{BACKSPACE}", 'Verify "\N{BS}" eq "\N{BACKSPACE}"');
is("\N{HT}", "\N{HORIZONTAL TABULATION}", 'Verify "\N{HT}" eq "\N{HORIZONTAL TABULATION}"');
is("\N{LF}", "\N{LINE FEED (LF)}", 'Verify "\N{LF}" eq "\N{LINE FEED (LF)}"');
@@ -1013,14 +1013,14 @@ is("\N{U+1D0C5}", "\N{BYZANTINE MUSICAL SYMBOL FTHORA SKLIRON CHROMA VASIS}", 'V
my $decimal = hex $code;
# The Unicode version 1 name is used instead of any that are
- # marked <control>
+ # marked <control>.
$name = $u1name if $name eq "<control>";
- $name = 'ALERT' if $decimal == 7;
+ # In earlier Perls, we reject this code point's name (BELL)
+ $name = "" if $^V lt v5.17.0 && $decimal == 0x1F514;
- # XXX This test should be changed for 5.16 when we convert to use
- # Unicode's BELL
- $name = "" if $decimal == 0x1F514;
+ # ALERT overrides BELL
+ $name = 'ALERT' if $decimal == 7;
# Some don't have names, leave those array elements undefined
next unless $name;
diff --git a/lib/unicore/mktables b/lib/unicore/mktables
index 559c519639..3b377f5676 100644
--- a/lib/unicore/mktables
+++ b/lib/unicore/mktables
@@ -11082,8 +11082,9 @@ END
sub filter_v6_ucd {
- # Unicode 6.0 co-opted the name BELL for U+1F514, but we haven't
- # accepted that yet to allow for some deprecation cycles.
+ # Unicode 6.0 co-opted the name BELL for U+1F514, but until 5.17,
+ # it wasn't accepted, to allow for some deprecation cycles. This
+ # function is not called after 5.16
return if $_ !~ /^(?:0007|1F514|070F);/;
@@ -13580,6 +13581,10 @@ END
# We only add in the controls.
next if $gc->value_of($code_point) ne 'Cc';
+ # We reject this Unicode1 name for later Perls, as it is used for
+ # another code point
+ next if $unicode_1_value eq 'BELL' && $^V ge v5.17.0;
+
# This won't add an exact duplicate.
$perl_charname->add_duplicate($code_point, $unicode_1_value,
Replace => $before_or_after);
@@ -17203,7 +17208,8 @@ my @input_file_objects = (
# And for 5.14 Perls with 6.0,
# have to also make changes
- : ($v_version ge v6.0.0)
+ : ($v_version ge v6.0.0
+ && $^V lt v5.17.0)
? \&filter_v6_ucd
: undef),
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 88d4ca1598..946f3f77dc 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -44,7 +44,13 @@ XXX For a release on a stable branch, this section aspires to be:
If any exist, they are bugs, and we request that you submit a
report. See L</Reporting Bugs> below.
-[ List each incompatible change as a =head2 entry ]
+=head2 C<\N{BELL}> now refers to U+1F514 instead of U+0007
+
+Unicode 6.0 reused the name "BELL" for a different code point than it
+traditionally had meant. Since Perl v5.14, use of this name still
+referred to U+0007, but would raise a deprecated warning. Now, "BELL"
+refers to U+1F514, and the name for U+0007 is "ALERT". All the
+functions in L<charnames> have been correspondingly updated.
=head1 Deprecations