X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/96087cbd88fd056ae34675abfb0e3e411f019763..ea4967f184bf0a27eaa2dc81da1084780756156a:/IkiWiki/Plugin/highlight.pm?ds=inline 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\((.*)\)=(.*)$/) {