]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/PNG_triggers_UTF-8_error_in_MimeInfo.pm.mdwn
why this is hard
[ikiwiki.git] / doc / bugs / PNG_triggers_UTF-8_error_in_MimeInfo.pm.mdwn
1 If a PNG image matches the [[ikiwiki/PageSpec]] of an [[ikiwiki/directive/inline]] directive, the page throws the following error:
2
3 > \[[!inline Error: Malformed UTF-8 character (fatal) at /usr/local/lib/perl5/site_perl/5.8.8/File/MimeInfo.pm line 120.]]
4
5 Individual posts display fine, and moving the offending image outside the scope of the [[ikiwiki/directive/inline]] directive's PageSpec eliminates the error.
6
7 > I tried to reproduce this with a random png and File::MimeInfo 
8 > version 0.15, but could not. The png was included in the generated feed
9 > via an enclosure, as it should be; no warnings or errors.
10
11 > Looking at the source to File::MimeInfo and its changelog,
12 > I'm pretty sure that this problem was fixed in version
13 > 0.14:
14 >>       - Fixed bug with malformed utf8 chars in default() method
15
16 > The code involved in that fix looks like this:
17 >
18 >>                 no warnings; # warnings can be thrown when input not ascii
19 >>                if ($] < 5.008 or ! utf8::valid($line)) {
20 >>                        use bytes; # avoid invalid utf8 chars
21 >
22 > I guess that your locally installed version of File::MimeInfo is older than
23 > this. So closing this bug [[done]]. If you still see the problem with a current
24 > version of File::MimeInfo, please reopen and include where I can get a png file
25 > that triggers the problem. --[[Joey]]