I was referring to the fact that the tr simply clobbers all Unicode characters, while Text::CleanFragment uses Text::Unidecode to try to turn them into ASCII:
use warnings; use strict; use utf8; use Text::CleanFragment; my $s = "Hello.txt"; print clean_fragment($s), "\n"; # prints "Hello.txt" $s =~ tr/A-Za-z0-9._-//cd; print "<$s>\n"; # prints "<>" !
(I've actually encountered filenames similar to the above in the wild)
In reply to Re^3: Removing unwanted chars from filename.
by haukex
in thread Removing unwanted chars from filename.
by Anonymous Monk
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |