summaryrefslogtreecommitdiff
path: root/lib/unicore
diff options
context:
space:
mode:
authorKarl Williamson <khw@khw-desktop.(none)>2010-01-11 22:25:15 -0700
committerRafael Garcia-Suarez <rgs@consttype.org>2010-01-15 16:45:56 +0100
commiteadadd41cf3b91c4e0b63a53abf2c79cdd87e9ac (patch)
treef18aa455a1df2b116a85f4e25124e4257306e602 /lib/unicore
parent0c07e5386c2f08c01ea359e36ce78758337a20b7 (diff)
downloadperl-eadadd41cf3b91c4e0b63a53abf2c79cdd87e9ac.tar.gz
PATCH: [perl #71726] \p{xdigit} should match full-width forms
The Unicode standard suggests that xdigit match not only the ASCII hex digits, but also the full width forms starting at U+FF10. This patch just changes the source from the Unicode ASCII hex digit to the Unicode normal hex digit.
Diffstat (limited to 'lib/unicore')
-rw-r--r--lib/unicore/mktables21
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/unicore/mktables b/lib/unicore/mktables
index 3771ea6826..6f66f84902 100644
--- a/lib/unicore/mktables
+++ b/lib/unicore/mktables
@@ -10837,18 +10837,18 @@ sub compile_perl() {
Initialize => $Digit & $ASCII,
);
- # AHex was not present in early releases
- # XXX TUS recommends Hex_Digit, not ASCII_Hex_Digit.
- my $Xdigit = $perl->add_match_table('XDigit',
- Description => '[0-9A-Fa-f]');
- my $AHex = property_ref('ASCII_Hex_Digit');
- if (defined $AHex && ! $AHex->is_empty) {
- $Xdigit->set_equivalent_to($AHex->table('Y'), Related => 1);
+ # Hex_Digit was not present in first release
+ my $Xdigit = $perl->add_match_table('XDigit');
+ my $Hex = property_ref('Hex_Digit');
+ if (defined $Hex && ! $Hex->is_empty) {
+ $Xdigit->set_equivalent_to($Hex->table('Y'), Related => 1);
}
else {
- # (Have to use hex because could be running on a non-ASCII machine,
- # and we want the Unicode (ASCII) values)
- $Xdigit->initialize([ 0x30..0x39, 0x41..0x46, 0x61..0x66 ]);
+ # (Have to use hex instead of e.g. '0', because could be running on an
+ # non-ASCII machine, and we want the Unicode (ASCII) values)
+ $Xdigit->initialize([ 0x30..0x39, 0x41..0x46, 0x61..0x66,
+ 0xFF10..0xFF19, 0xFF21..0xFF26, 0xFF41..0xFF46]);
+ $Xdigit->add_description('[0-9A-Fa-f] and corresponding fullwidth versions, like U+FF10: FULLWIDTH DIGIT ZERO');
}
my $dt = property_ref('Decomposition_Type');
@@ -14208,3 +14208,4 @@ Error('\p{Script=InGreek}'); # Bug #69018
Test_X("1100 $nobreak 1161"); # Bug #70940
Expect(0, 0x2028, '\p{Print}', ""); # Bug # 71722
Expect(0, 0x2029, '\p{Print}', ""); # Bug # 71722
+Expect(1, 0xFF10, '\p{XDigit}', ""); # Bug # 71726