
|
A different approach, useful for the standard filehandles,
or perhaps filehandles created elsewhere, e.g. inside the
Test::More module (which perhaps unfortunately, uses it's
own newly created STDOUT and STDERR, so binmoding the existing
ones doesn't do you any good).
In this example, we don't say ":encoding(UTF-8)", but rather
":utf8" which invokes perl's "lax" form that does no checking
for malformed UTF-8. There's a school of thought that says this
is appropriate for output (which has probably been checked
already), but not for input, where it's actually a
potential security hole.
|