Item12027: Foswiki::Logger::PlainFile: properly handle non-Unicode UTF-8 strings

... maybe that sounds a bit weird, so here's an explanation.

In theory, you use Perl's Unicode-aware strings in modern Perl code. The code
here assumed that PerlIO would do the right thing for byte strings
(traditional non-Unicode-aware strings), too... but in this case it doesn't if
the site charset is UTF-8. In that case, the byte string will contain UTF-8
but Perl will assume that it's the system's native locale (or something like
that), and thus the PerlIO encoding layer will encode the UTF-8 *again*,
resulting in "double UTF-8 encoding".

Hence, PerlIO encoding should only be used if we're dealing with a proper
Unicode string.


git-svn-id: http://svn.foswiki.org/trunk/core@17201 0b4bb1d4-4e5a-0410-9cc4-b2b747904278