Sys::Syslog is not UTF-8-literate.
# keep a copy to avoid editing the original config repeatedly
my $wikiname = $config{wikiname};
utf8::encode($wikiname);
# keep a copy to avoid editing the original config repeatedly
my $wikiname = $config{wikiname};
utf8::encode($wikiname);
- Sys::Syslog::syslog($type, "[$wikiname] %s", join(" ", @_));
+ my $message = join(" ", @_);
+ utf8::encode($message);
+ Sys::Syslog::syslog($type, "[$wikiname] %s", $message);
};
if ($@) {
print STDERR "failed to syslog: $@" unless $log_failed;
};
if ($@) {
print STDERR "failed to syslog: $@" unless $log_failed;
$IkiWiki::config{wikiname} = 'ASCII';
is(debug('test'), '', 'plain ASCII syslog');
$IkiWiki::config{wikiname} = 'not ⒶSCII';
$IkiWiki::config{wikiname} = 'ASCII';
is(debug('test'), '', 'plain ASCII syslog');
$IkiWiki::config{wikiname} = 'not ⒶSCII';
-is(debug('test'), '', 'UTF8 syslog');
+is(debug('𝗧ĕṡҭ'), '', 'UTF8 syslog');
my $orig = $IkiWiki::config{wikiname};
is(debug('test'), '', 'check for idempotency');
is($IkiWiki::config{wikiname}, $orig, 'unchanged config');
my $orig = $IkiWiki::config{wikiname};
is(debug('test'), '', 'check for idempotency');
is($IkiWiki::config{wikiname}, $orig, 'unchanged config');