File tree Expand file tree Collapse file tree 4 files changed +37
-11
lines changed Expand file tree Collapse file tree 4 files changed +37
-11
lines changed Original file line number Diff line number Diff line change @@ -3850,7 +3850,6 @@ The complete list of accepted paired delimiters as of Unicode 14.0 is:
3850
3850
{ } U+007B, U+007D LEFT/RIGHT CURLY BRACKET
3851
3851
« » U+00AB, U+00BB LEFT/RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
3852
3852
» « U+00BB, U+00AB RIGHT/LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
3853
- ܆ ܇ U+0706, U+0707 SYRIAC COLON SKEWED LEFT/RIGHT
3854
3853
༺ ༻ U+0F3A, U+0F3B TIBETAN MARK GUG RTAGS GYON, TIBETAN MARK GUG
3855
3854
RTAGS GYAS
3856
3855
༼ ༽ U+0F3C, U+0F3D TIBETAN MARK ANG KHANG GYON, TIBETAN MARK ANG
@@ -4231,5 +4230,4 @@ The complete list of accepted paired delimiters as of Unicode 14.0 is:
4231
4230
🢩 🢨 U+1F8A9, U+1F8A8 RIGHT/LEFTWARDS BACK-TILTED SHADOWED WHITE ARROW
4232
4231
🢫 🢪 U+1F8AB, U+1F8AA RIGHT/LEFTWARDS FRONT-TILTED SHADOWED WHITE
4233
4232
ARROW
4234
-
4235
4233
=cut
Original file line number Diff line number Diff line change 378
378
my $illegal = " Mirror illegal" ;
379
379
my $no_encoded_mate = " Mirrored, but Unicode has no encoded mirror" ;
380
380
my $bidirectional = " Bidirectional" ;
381
+ my $r2l = " Is in a Right to Left script" ;
381
382
382
383
my %unused_bidi_pairs ;
383
384
my %inverted_unused_bidi_pairs ;
634
635
next ;
635
636
}
636
637
638
+ # Exclude characters that are R to L ordering, as this can cause
639
+ # confusion. See GH #22228
640
+ if ($chr =~ / (?[ \p {Bidi_Class:R} + \p {Bidi_Class:AL} ]) /x ) {
641
+ $discards {$code_point } = { reason => $r2l ,
642
+ mirror => $mirror_code_point
643
+ };
644
+ next ;
645
+ }
646
+
637
647
# We enter the pair with the original code point on the left; if it
638
648
# should instead be on the R, swap. Most Symbols that contain the
639
649
# word REVERSE go on the rhs, except those whose names explicitly
Original file line number Diff line number Diff line change @@ -133,6 +133,24 @@ EXPECT
133
133
Use of '«' is deprecated as a string delimiter at - line 3.
134
134
Can't find string terminator "«" anywhere before EOF at - line 5.
135
135
########
136
+ # NAME mirrored delimiters in R-to-L scripts are invalid
137
+ BEGIN { binmode STDERR, ":utf8" }
138
+ use utf8;
139
+ use feature 'extra_paired_delimiters';
140
+ my $good = q܈this string is delimitted by a symbol in a R-to-L script܈;
141
+ $good = q܇this string is delimitted by a symbol in a R-to-L script܇;
142
+ my $bad = q܈Can't use mirrored R-to-L script delimiters܇;
143
+ EXPECT
144
+ Can't find string terminator "܈" anywhere before EOF at - line 6.
145
+ ########
146
+ # NAME mirrored delimiters in R-to-L scripts are invalid in the other order too
147
+ BEGIN { binmode STDERR, ":utf8" }
148
+ use utf8;
149
+ use feature 'extra_paired_delimiters';
150
+ my $bad = q܇Can't use mirrored R-to-L script delimiters܈;
151
+ EXPECT
152
+ Can't find string terminator "܇" anywhere before EOF at - line 4.
153
+ ########
136
154
# NAME paired above Latin1 delimiters need feature enabled
137
155
BEGIN { binmode STDERR, ":utf8" }
138
156
use utf8;
You can’t perform that action at this time.
0 commit comments