This makes text files that have UTF8 bits in them render
normally. Certainly this is not ideal but it shall suffice.
requires 'Template' => '2.22';
requires 'Template::Provider::Encoding';
requires 'Template::Plugin::Cycle';
+requires 'Template::Plugin::UTF8Decode';
requires 'Config::General';
);
}
+ utf8::decode($c->stash->{blob});
$c->response->body(delete $c->stash->{blob});
}
<div class='blob'>This is a binary file which won't render natively on the web, but you can get it here all the same: <a href="[% c.uri_for_action('/ref/raw', c.req.captures, filename) %]" title="[% filename %]">[% filename %]</a></div>
[%- ELSE -%]
[%- INCLUDE inc/syntax_highlight_css.tt2 -%]
-<pre class='blob'>[% IF mangled; blob; ELSE; blob | html; END; %]</pre>
+[%- USE UTF8Decode -%]
+<pre class='blob'>[% IF mangled; blob; ELSE; blob | utf8_decode | html; END; %]</pre>
[%- END -%]