X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d7204bba1d32fccadf9441eb66555d41fc629320..f2f7263c3f16286213f0d9549b7176725a8da6b3:/tests/regex/regex.pl diff --git a/tests/regex/regex.pl b/tests/regex/regex.pl index cf2ba46d59..d05363d8a4 100755 --- a/tests/regex/regex.pl +++ b/tests/regex/regex.pl @@ -39,26 +39,26 @@ sub quotecxx { "\013" => "v", '"' => '"', "\\" => "\\" ); # working around lack of 'use encoding' - $_ = pack "U0C*", unpack "C*", $_; - use utf8; + if (!$utf) { + $_ = pack "U0C*", unpack "C*", $_; + use utf8; + } s/[\000-\037"\\\177-\x{ffff}]/ if ($esc{$&}) { "\\$esc{$&}"; - } elsif (ord($&) > 0x9f) { - if ($utf) { - $&; - } else { - sprintf "\\u%04x", ord($&); - } + } elsif (ord($&) > 0x9f && !$utf) { + sprintf "\\u%04x", ord($&); } else { sprintf "\\%03o", ord($&); } /ge; # working around lack of 'use encoding' - no utf8; - $_ = pack "C*", unpack "C*", $_; + if (!$utf) { + no utf8; + $_ = pack "C*", unpack "C*", $_; + } return ($utf ? '"' : 'L"') . $_ . '"' } @@ -426,7 +426,7 @@ for (@input) my $results = $opts =~ /-inline/ && $test ne 'f' ? $extras[$i+2] : ''; # get them all in the right order and print - unshift @args, $test, parsetcl($id), '-'; + unshift @args, $test, parsetcl($id), $results ? '-' : 'o'; push @args, parsetcl(parsetcl($results)) if $results; handle_test @args; }