diff options
author | Joey Hess <joey@kitenet.net> | 2012-01-30 15:08:50 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-01-30 15:09:37 -0400 |
commit | a78126c55ecbe014ab2a214f324b32762e6a268d (patch) | |
tree | b8f128ff730f79d9573a867f8af880e0230f0903 /IkiWiki/Plugin/comments.pm | |
parent | 0ba0d0982455297446ed777aa89d1fbf8989d2ae (diff) | |
download | ikiwiki-a78126c55ecbe014ab2a214f324b32762e6a268d.tar ikiwiki-a78126c55ecbe014ab2a214f324b32762e6a268d.tar.gz |
calendar, prettydate: Fix strftime encoding bug
strftime is a C function, it does not return decoded utf8.
Several places in ikiwiki manually decoded it, but at least two
forgot to.
Also, strftime might not return even encoded utf8, if LC_TIME is set
to a non-utf8 value. Went ahead and supported decoding whatever encoding
it uses.
The remaining direct calls to strftime() are all ones that first set
LC_TIME=C, in order to get times that are not for human display.
Diffstat (limited to 'IkiWiki/Plugin/comments.pm')
-rw-r--r-- | IkiWiki/Plugin/comments.pm | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 3ad2a0e13..91a482ed6 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -9,7 +9,6 @@ use warnings; use strict; use IkiWiki 3.00; use Encode; -use POSIX qw(strftime); use constant PREVIEW => "Preview"; use constant POST_COMMENT => "Post comment"; @@ -460,7 +459,7 @@ sub editcomment ($$) { } $content .= " subject=\"$subject\"\n"; - $content .= " date=\"" . decode_utf8(strftime('%Y-%m-%dT%H:%M:%SZ', gmtime)) . "\"\n"; + $content .= " date=\"" . strftime_utf8('%Y-%m-%dT%H:%M:%SZ', gmtime) . "\"\n"; my $editcontent = $form->field('editcontent'); $editcontent="" if ! defined $editcontent; |