* YA utf-8 patch from Recai, this time to fix previewing a page so that
[ikiwiki.git] / IkiWiki / CGI.pm
index 986a8ee1d6b78a0c107d7732d787282ef1b40a7c..4f4c488762ee477245cb3ad79dc39ae449fdac59 100644 (file)
@@ -353,9 +353,12 @@ sub cgi_editpage ($$) { #{{{
        }
        elsif ($form->submitted eq "Preview") {
                require IkiWiki::Render;
+               require Encode;
+               my $content = Encode::decode_utf8($form->field('editcontent'));
+               $form->field(name => "editcontent", value => $content, force => 1);
                $form->tmpl_param("page_preview",
-                       htmlize($config{default_pageext},
-                               linkify($page, $page, $form->field('editcontent'))));
+                       Encode::decode_utf8(htmlize($config{default_pageext},
+                               linkify($page, $page, $content))));
        }
        else {
                $form->tmpl_param("page_preview", "");