in reply to Malformed UTF-8 character Error
That just converts all non-visible, non-ascii bytes to "." -- which allows you to see where the non-printable stuff is, while leaving the printable ascii stuff legible, with no worries about character encoding errors.use strict; use warnings; my $log = shift # let's put the log file name in @ARGV or die "Usage: $0 name_of_input_file\n"; open(my $fh, '<:raw:perlio', $log) or die("Can't open input file \"$log\": $!\n"); while (<$fh>) { tr/\x09\x0a\x0d -~/./c; print; }
|
|---|