summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/CGI.pm1
-rw-r--r--IkiWiki/Rcs/svn.pm3
-rw-r--r--IkiWiki/Render.pm19
3 files changed, 14 insertions, 9 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
index f589ca41d..d9c9fe828 100644
--- a/IkiWiki/CGI.pm
+++ b/IkiWiki/CGI.pm
@@ -485,6 +485,7 @@ sub cgi_editpage ($$) { #{{{
force => 1);
$form->tmpl_param("page_conflict", 1);
$form->field("editcontent", value => $conflict, force => 1);
+ $form->field(name => "comments", value => Encode::decode_utf8($form->field('comments')), force => 1);
$form->field("do", "edit)");
$form->tmpl_param("page_select", 0);
$form->field(name => "page", type => 'hidden');
diff --git a/IkiWiki/Rcs/svn.pm b/IkiWiki/Rcs/svn.pm
index 5474e3be2..42ded0cea 100644
--- a/IkiWiki/Rcs/svn.pm
+++ b/IkiWiki/Rcs/svn.pm
@@ -64,7 +64,8 @@ sub rcs_commit ($$$) { #{{{
}
}
- if (system("svn", "commit", "--quiet", "-m",
+ if (system("svn", "commit", "--quiet",
+ "--encoding", "UTF-8", "-m",
possibly_foolish_untaint($message),
"$config{srcdir}") != 0) {
my $conflict=readfile("$config{srcdir}/$file");
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
index 22fba3a2f..d23dfdc25 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
@@ -33,7 +33,12 @@ sub htmlize ($$) { #{{{
}
if ($type eq '.mdwn') {
- $content=Encode::decode_utf8(Markdown::Markdown(Encode::encode_utf8($content)));
+ # XXX explanation of this insanity wating on perl bug number
+ $content=Encode::encode_utf8($content);
+ $content=Encode::encode_utf8($content);
+ $content=Markdown::Markdown($content);
+ $content=Encode::decode_utf8($content);
+ $content=Encode::decode_utf8($content);
}
else {
error("htmlization of $type not supported");
@@ -230,13 +235,11 @@ sub check_overwrite ($$) { #{{{
sub displaytime ($) { #{{{
my $time=shift;
- if ($config{timeformat} eq '%c' && ! exists $ENV{LC_CTIME}) {
- return scalar(localtime($time)); # optimisation
- }
- else {
- eval q{use POSIX};
- return POSIX::strftime($config{timeformat}, localtime($time));
- }
+ eval q{use POSIX};
+ # strftime doesn't know about encodings, so make sure
+ # its output is properly treated as utf8
+ return Encode::decode_utf8(POSIX::strftime(
+ $config{timeformat}, localtime($time)));
} #}}}
sub mtime ($) { #{{{