perl-unicode

tr///d does not seem to work

1998-10-14 13:32:14
use utf8;

$_ = "abc...\x{e6}\x{f8}\x{e5}";
tr/\x{7F}-\x{FF}//d;

print "not " unless $_ eq "abc...";
print "ok 6\n";

print udump($_), "\n";

sub udump
{
   my $str = shift;
   $str =~ s/\\/\\\\/g;
   $str =~ s/([^\040-\176])/sprintf "\\x{%04x}", ord($1)/ge;
   $str;
}

<Prev in Thread] Current Thread [Next in Thread>