use strict;
use warnings;
use File::Spec;
-our $VERSION = '1.16';
+our $VERSION = '1.17';
use bytes (); # for $bytes::hint_bits
'EOT' => pack("U", 0x04), # END OF TRANSMISSION
'ENQ' => pack("U", 0x05), # ENQUIRY
'ACK' => pack("U", 0x06), # ACKNOWLEDGE
- 'BEL' => pack("U", 0x07), # BELL
+ 'BEL' => pack("U", 0x07), # ALERT; formerly BELL
'BS' => pack("U", 0x08), # BACKSPACE
'HT' => pack("U", 0x09), # HORIZONTAL TABULATION
'LF' => pack("U", 0x0A), # LINE FEED (LF)
'PARTIAL LINE UP' => pack("U", 0x8C), # PARTIAL LINE BACKWARD
'VERTICAL TABULATION SET' => pack("U", 0x8A), # LINE TABULATION SET
'REVERSE INDEX' => pack("U", 0x8D), # REVERSE LINE FEED
+
+ # Unicode 6.0 co-opted this for U+1F514, so deprecate it for now.
+ 'BELL' => pack("U", 0x07),
);
ok(grep { /"HORIZONTAL TABULATION" is deprecated.*CHARACTER TABULATION/ } @WARN);
+ # XXX These tests should be changed for 5.16, when we convert BELL to the
+ # Unicode version.
+ is("\N{BELL}", "\a");
+ ok((grep{ /"BELL" is deprecated.*ALERT/ } @WARN), 'BELL is deprecated');
+
no warnings 'deprecated';
is("\N{VERTICAL TABULATION}", "\013");
# marked <control>
$name = $u1name if $name eq "<control>";
+ $name = 'ALERT' if $decimal == 7;
+
+ # XXX This test should be changed for 5.16 when we convert to use
+ # Unicode's BELL
+ $name = "" if $decimal == 0x1F514;
+
# Some don't have names, leave those array elements undefined
next unless $name;
}
return;
}
+
+ sub filter_v6_ucd {
+
+ # Unicode 6.0 co-opted the name BELL for U+1F514, so change the input
+ # to pretend that U+0007 is ALERT instead, and for Perl 5.14, don't
+ # allow the BELL name for U+1F514, so that the old usage can be
+ # deprecated for one cycle.
+
+ return if $_ !~ /^(?:0007|1F514);/;
+
+ my ($code_point, @fields) = split /\s*;\s*/, $_, -1;
+ if ($code_point eq '0007') {
+ $fields[$UNICODE_1_NAME] = "ALERT";
+ }
+ elsif ($^V lt v5.15.0) { # For 5.16 will convert to use Unicode's name
+ $fields[$CHARNAME] = "";
+ }
+
+ $_ = join ';', $code_point, @fields;
+
+ return;
+ }
} # End closure for UnicodeData
sub process_GCB_test {
? \&filter_v1_ucd
: ($v_version eq v2.1.5)
? \&filter_v2_1_5_ucd
- : undef),
+
+ # And for 5.14 Perls with 6.0,
+ # have to also make changes
+ : ($v_version ge v6.0.0)
+ ? \&filter_v6_ucd
+ : undef),
# And the main filter
\&filter_UnicodeData_line,
detail in L<perlvar/"${^GLOBAL_PHASE}"> and
L<perlmod/"BEGIN, UNITCHECK, CHECK, INIT and END">.
-=head2 Unicode Version 6.0 is now supported.
+=head2 Unicode Version 6.0 is now supported (mostly)
-Perl comes with the Unicode 6.0 data base.
+Perl comes with the Unicode 6.0 data base, with one exception noted
+below.
See L<http://unicode.org/versions/Unicode6.0.0> for details on the new
release. Perl does not support any Unicode provisional properties,
including the new ones for this release, but their database files are
packaged with Perl.
+Unicode 6.0 has chosen to use the name C<BELL> for the character at U+1F514,
+which is a symbol that looks like a bell, and used in Japanese cell
+phones. This conflicts with the long-standing Perl usage of having
+C<BELL> mean the ASCII C<BEL> character, U+0007. In Perl 5.14,
+C<\N{BELL}> will continue to mean U+0007, but its use will generate a
+deprecated warning message, unless such warnings are turned off. The
+new name for U+0007 in Perl will be C<ALERT>, which corresponds nicely
+with the existing shorthand sequence for it, C<"\a">. C<\N{BEL}> will
+mean U+0007, with no warning given. The character at U+1F514 will not
+have a name in 5.14, but can be referred to by C<\N{U+1F514}>. The plan
+is that in Perl 5.16, C<\N{BELL}> will refer to U+1F514, and so all code
+that uses C<\N{BELL}> should convert by then to using C<\N{ALERT}>,
+C<\N{BEL}>, or C<"\a"> instead.
+
=head1 Security
XXX Any security-related notices go here. In particular, any security
[ List each deprecation as a =head2 entry ]
+=head2 C<\N{BELL}> is deprecated
+
+This is because Unicode is using that name for a different character.
+See L</Unicode Version 6.0 is now supported (mostly)> for more
+explanation.
+
=head1 Performance Enhancements
XXX Changes which enhance performance without changing behaviour go here. There