File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -584,6 +584,32 @@ else {
584
584
EOF
585
585
}
586
586
587
+ SKIP:
588
+ {
589
+ my @locales = find_locales( [ qw( LC_CTYPE LC_COLLATE) ] );
590
+ my (undef , $non_utf8_ref ) = classify_locales_wrt_utf8ness(\@locales );
591
+ my @non_utf8_locales = grep { $_ !~ / \b C \b | POSIX /x }
592
+ $non_utf8_ref -> @*;
593
+ skip " didn't find a suitable non-UTF-8 locale" , 1 unless
594
+ @non_utf8_locales ;
595
+ my $locale = $non_utf8_locales [0];
596
+
597
+ fresh_perl_is(<<"EOF" , " ok\n " , {}, " Handles above Latin1 and NUL in non-UTF8 locale" );
598
+ use locale;
599
+ use POSIX qw(setlocale LC_COLLATE);
600
+ if (setlocale(LC_COLLATE, '$locale ')) {
601
+ my \$ x = "A\\ xB5\\ x00B";
602
+ utf8::upgrade(\$ x);
603
+ my \$ y = "\\ x{100}";
604
+ my \$ cmp = \$ x cmp \$ y;
605
+ print \$ cmp <= 0 ? "ok\n " : "not ok\n ";
606
+ }
607
+ else {
608
+ print "ok\n ";
609
+ }
610
+ EOF
611
+ }
612
+
587
613
SKIP: { # GH #20085
588
614
my @utf8_locales = find_utf8_ctype_locales();
589
615
skip " didn't find a UTF-8 locale" , 1 unless @utf8_locales ;
You can’t perform that action at this time.
0 commit comments