in reply to Search & replace of UTF-8 characters ?

Thank you for the answer and the explanations! It works as it should now, and I learned a thing or two about perl and UTF-8. :-)

Indeed I hadn't realised that the "easy" way of doing a search & replace does not use STDIN but ARGV, and also that it does not consider the input files as being UTF-8 encoded by default...
  • Comment on Re: Search & replace of UTF-8 characters ?

Replies are listed 'Best First'.
Re^2: Search & replace of UTF-8 characters ?
by ikegami (Patriarch) on Feb 26, 2010 at 06:20 UTC

    and also that it does not consider the input files as being UTF-8 encoded by default...

    Perl has no idea what's in the file. It cannot assume the file's content is text encoded with UTF-8. In fact, it cannot assume the file's content is text at all. Unless you tell Perl otherwise, it gives you the file's contents: bytes.

      perl does assume it is text, that is why you have to binmode