X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/4b81616c0468956b434207fc7266cb3eb4d1bbfa..c769a33392c4dedbabfb1fa1fda5c8bb30b84c78:/IkiWiki/Plugin/highlight.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/highlight.pm b/IkiWiki/Plugin/highlight.pm index 20f79ef57..e517ac5c0 100644 --- a/IkiWiki/Plugin/highlight.pm +++ b/IkiWiki/Plugin/highlight.pm @@ -4,6 +4,7 @@ package IkiWiki::Plugin::highlight; use warnings; use strict; use IkiWiki 3.00; +use Encode; # locations of highlight's files my $filetypes="/etc/highlight/filetypes.conf"; @@ -22,6 +23,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => 1, # format plugin + section => "format", }, tohighlight => { type => "string", @@ -69,7 +71,7 @@ sub htmlizefallback { return; } - return highlight($langfile, shift); + return Encode::decode_utf8(highlight($langfile, shift)); } my %ext2lang; @@ -78,7 +80,7 @@ my %highlighters; # Parse highlight's config file to get extension => language mappings. sub read_filetypes () { - open (IN, $filetypes); + open (IN, $filetypes) || error("$filetypes: $!"); while () { chomp; if (/^\$ext\((.*)\)=(.*)$/) {