fork download
  1. #!/usr/bin/perl
  2. use utf8;
  3. my $file='myimageऄwithधDevanagariमcharsफ.png';
  4. my $filenew=$file=~ s/(.)(?{ if (ord $1 >127 ){'x'} else {$1} })/$^R/gr;
  5.  
  6. print "before: ",$file,"\n";
  7. print "after: ",$filenew,"\n";
Success #stdin #stdout #stderr 0s 6000KB
stdin
Standard input is empty
stdout
before: myimageऄwithधDevanagariमcharsफ.png
after: myimagexwithxDevanagarixcharsx.png
stderr
Wide character in print at prog.pl line 6.