Subject: | binmode support for logging non-ASCII strings |
Please add binmode support for logging strings with non-ASCII characters. The workaround
is fairly easy (pass a pre-configured filehandle instead of a filename), but it took a beginner
like me several hours and a some help from usenet to figure out what was going on. Maybe
at least post the workaround in the documentation.
The workaround is:
use strict;
use warnings;
my $logfh;
BEGIN {
open ($logfh, '>:utf8', 'here2.log') or die("Stopped: $!");
}
use Log::StdLog { level => 'warn', handle => $logfh };
print {*STDLOG} "The smiley <\x{263a}> is here.";
close $logfh;
It is solution (2) given by Mumia W. in:
http://groups.google.com/group/comp.lang.perl.misc/browse_thread/thread/64f35151691
04693/c328112be334704f?lnk=st&q=StdLog&rnum=2#c328112be334704f
Thanks,
Jerry Krinock