#!/usr/bin/perl
use utf8;
my $file='myimageऄwithधDevanagariमcharsफ.png';
my $filenew=$file=~ s/(.)(?{ if (ord $1 >127 ){'x'} else {$1} })/$^R/gr
;
print "before: ",$file,"\n"; print "after: ",$filenew,"\n";
ICAgICMhL3Vzci9iaW4vcGVybAogICAgdXNlIHV0Zjg7CiAgICBteSAkZmlsZT0nbXlpbWFnZeCkhHdpdGjgpKdEZXZhbmFnYXJp4KSuY2hhcnPgpKsucG5nJzsKICAgIG15ICRmaWxlbmV3PSRmaWxlPX4gcy8oLikoP3sgaWYgKG9yZCAkMSA+MTI3ICl7J3gnfSBlbHNlIHskMX0gfSkvJF5SL2dyOwogICAgIAogICAgcHJpbnQgImJlZm9yZTogIiwkZmlsZSwiXG4iOwogICAgcHJpbnQgImFmdGVyOiAiLCRmaWxlbmV3LCJcbiI7