#!/usr/bin/perl
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";
ICAgICAgICAjIS91c3IvYmluL3BlcmwKICAgICAgCiAgICAgICAgbXkgJGZpbGU9J215aW1hZ2XgpIR3aXRo4KSnRGV2YW5hZ2FyaeCkrmNoYXJz4KSrLnBuZyc7CiAgICAgICAgbXkgJGZpbGVuZXc9JGZpbGU9fiBzLyguKSg/eyBpZiAob3JkICQxID4xMjcgKXsneCd9IGVsc2UgeyQxfSB9KS8kXlIvZ3I7CiAgICAgCiAgICAgICAgcHJpbnQgImJlZm9yZTogIiwkZmlsZSwiXG4iOwogICAgICAgIHByaW50ICJhZnRlcjogIiwkZmlsZW5ldywiXG4iOw==