I am parsing a very large log file with Perl. The code is:
open($input_handle, '<:encoding(UTF-8)', $input_file);
while (<$input_handle>) {
...
}
close($input_handle);
However, sometimes the log file contains faulty characters, and I get the following message:
utf8 "\xD0" does not map to Unicode at log_parser.pl line 32, <$input_handle> line 10920.
I am aware of the characters and I would just like to ignore them without the log message flooding my (Windows!) build server logs. I tried no warnings 'utf8';
but it did not help.
How can I suppress the message?