From: Mischa POSLAWSKY Date: Tue, 3 Feb 2015 00:22:18 +0000 (+0100) Subject: source: encode vim output before link parsing X-Git-Tag: v1.6~30 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/30aead0ab08ff78d7814a17fca4ec3b575b52450 source: encode vim output before link parsing Do not keep operating on octet strings. --- diff --git a/source.plp b/source.plp index f98c0ec..469f49e 100644 --- a/source.plp +++ b/source.plp @@ -85,6 +85,7 @@ else { print "
\n";
 		foreach (@$parsed) {
 			my ($type, $contents) = @{$_};
+			$contents = Encode::decode_utf8($contents);
 			my $tag = $type && ($TYPETAG{$type} || 'span');
 			my $arg = '';
 			print "<$tag$arg class=\"sy-\l$type\">" if $tag;
@@ -95,7 +96,7 @@ else {
 			if (!$type and $contents =~ s/^(\s*)([A-Z]\w+(?:::\w+)+)(?![^;\s])//) {
 				printf '%s%s', $1, "/source/$2", $2;
 			}
-			print Text::VimColor::_xml_escape(Encode::decode_utf8($contents));
+			print Text::VimColor::_xml_escape($contents);
 			print "" if $tag;
 		}
 		print "
\n";