From: Mischa POSLAWSKY Date: Wed, 8 Dec 2010 23:06:55 +0000 (+0100) Subject: source: preserve utf8 of unhighlighted input X-Git-Tag: v1.4~21 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/3bcb9f02e4e905b9fd12fa2401858445111e8617 source: preserve utf8 of unhighlighted input PLP::ReadFile() is declared before open mode can be set to :utf8, so may cause corruption if not converted back to unicode. --- diff --git a/source.plp b/source.plp index 83a5833..ee129ce 100644 --- a/source.plp +++ b/source.plp @@ -76,7 +76,10 @@ else { print "\n"; } else { - print "
\n", EscapeHTML(ReadFile($source)), "
\n"; + require Encode; + print "
\n";
+		print EscapeHTML(Encode::decode_utf8(ReadFile($source)));
+		print "
\n"; } print "\n";