Subject: | Use of encoding |
"syslog" is a typical traditional UNIX product: it is not bothering
about characer encodings at all, assuming mostly ASCII. The Sys::Syslog
function syslog() does just that: writes byte strings to the kernel
interface without conversion.
Newer implementations of Syslog assume utf-8. Probably we cannot find
out what root uses automatically :( For comparible Windows solutions I
expect UTF-16 is the right encoding. But at least, ::syslog() should
convert into some fixed character encoding, and not send a mixture of
latin1/fake-utf-8 internal string representation bytes.
Syslog calls are made too often to make it the user's responsibility to
do the encoding. Just as users are not bothered with this for each
print statement.
Suggestion of interface change like binmode:
openlog $name, "ndelay,pid,encoding(utf-8)", "local0";
openlog $name, "ndelay,pid,raw", "local0";
raw = current behavior. The openlog() is called in the user's script,
not inside general modules, and the user is the only one who may know
what encoding is used by the super-user.
I would like to see utf-8 as default, because it overlaps with the
original ASCII assumption AND is rapidly growing to become the default
on UNIXes. On Windows, the default would be UTF-16. (I am not an
expert on Windows, to say the least).
(second change proposal follows soon)