BEGIN { $| = 1; print "1..14\n"; }
END {print "not ok 1\n" unless $loaded;}
use String::Multibyte;
$^W = 1;
$loaded = 1;
print "ok 1\n";
$mb = String::Multibyte->new('ShiftJIS',1);
#####
%hash = $mb->strtr(
'µ¸¯³â@¢Íɵݢé@¹Ý̱¦',
" -±â-ë", "", "h");
$join = join ':', map "$_=>$hash{$_}", sort keys %hash;
print $join eq '¢=>2:¦=>1:¯=>1:±=>1:â=>1:é=>1'
? "ok" : "not ok", " 2\n";
$hash = $mb->strtr(
'µ¸¯³â@¢Íɵݢé@¹Ý̱¦',
" -±â-ë", "", "h");
$join = join ':', map "$_=>$$hash{$_}", sort keys %$hash;
print $join eq '¢=>2:¦=>1:¯=>1:±=>1:â=>1:é=>1'
? "ok" : "not ok", " 3\n";
%hash = $mb->strtr('ú{êÌJ^Ji', '-ñ@-¦-ß', '', 'h');
$join = join ':', map "$_=>$hash{$_}", sort keys %hash;
print $join eq 'Ì=>1:J=>2:^=>1:i=>1'
? "ok" : "not ok", " 4\n";
$str = 'ú{êÌJ^Ji';
%hash = $mb->strtr(\$str, '-ñ@-', '@--ñ', 'h');
$join = join ':', map "$_=>$hash{$_}", sort keys %hash;
print $join eq 'Ì=>1:J=>2:^=>1:i=>1'
? "ok" : "not ok", " 5\n";
print $str eq 'ú{êm©½©È'
? "ok" : "not ok", " 6\n";
$str = 'ú{êÌJ^JiÌ{';
%hash = $mb->strtr(\$str, '-ñ@-', '', 'cdh');
$join = join ':', map "$_=>$hash{$_}", sort keys %hash;
print $join eq 'ê=>1:ú=>1:{=>2'
? "ok" : "not ok", " 7\n";
print $str eq 'ÌJ^JiÌ'
? "ok" : "not ok", " 8\n";
$str = 'ú{êÌJ^JiÌ{';
%hash = $mb->strtr(\$str, '-ñ@-', '', 'dh');
$join = join ':', map "$_=>$hash{$_}", sort keys %hash;
print $join eq 'Ì=>2:J=>2:^=>1:i=>1'
? "ok" : "not ok", " 9\n";
print $str eq 'ú{ê{'
? "ok" : "not ok", " 10\n";
$str = 'ú{êÌJ^JiÌ{';
%hash = $mb->strtr(\$str, '-ñ@-', '', 'ch');
$join = join ':', map "$_=>$hash{$_}", sort keys %hash;
print $join eq 'ê=>1:ú=>1:{=>2'
? "ok" : "not ok", " 11\n";
print $str eq 'ú{êÌJ^JiÌ{'
? "ok" : "not ok", " 12\n";
$str = '{Ìú{êÌJ^JiÌ{';
%hash = $mb->strtr(\$str, '-ñ@-', '!', 'ch');
$join = join ':', map "$_=>$hash{$_}", sort keys %hash;
print $join eq 'ê=>1:=>1:ú=>1:{=>3'
? "ok" : "not ok", " 13\n";
print $str eq '!!Ì!!!ÌJ^JiÌ!'
? "ok" : "not ok", " 14\n";
1;
__END__