in reply to How to remove wide chars (ex: 年 or &#x6216) from a text file?

my $badstuff = read_file( $file, { binmode => ':raw' } ); $string =~ s/\Q$badstuff\E//;
now $string no longer has $badstuff, whatever it is

see File::Slurp, binmode, quotemeta, Data::Dump

  • Comment on Re: How to remove wide chars (ex: 年 or &#x6216) from a text file?
  • Download Code