Jacode
view release on metacpan or search on metacpan
t/9080_cheatsheets.t view on Meta::CPAN
# Remove all valid UTF-8 sequences; anything left is invalid.
$copy =~ s/[\x00-\x7F]//g; # US-ASCII
$copy =~ s/[\xC2-\xDF][\x80-\xBF]//g; # 2-byte
$copy =~ s/[\xE0-\xEF][\x80-\xBF]{2}//g; # 3-byte
$copy =~ s/[\xF0-\xF4][\x80-\xBF]{3}//g; # 4-byte
ok( $file_ok && length($copy) == 0,
"$lang CS1 file is valid UTF-8" );
}
# Decode raw bytes as UTF-8 string for text checks
# (simple: treat as Latin-1 overlay; exact match strings are ASCII
# or will be embedded as UTF-8 literals in this source file)
$content = $raw;
#------------------------------------------------------------------
# CS4: header line 2 contains "(XX)"
#------------------------------------------------------------------
{
my @lines = split /\n/, $content;
my $line2 = defined($lines[1]) ? $lines[1] : '';
ok( $line2 =~ /\(\Q$lang\E\)/,
( run in 0.719 second using v1.01-cache-2.11-cpan-e1769b4cff6 )