Last modified: 2005-11-19 06:23:24 UTC
EasyTimeline replaces all characters above 255 and even some in that range with ASCII approximations or underscores. This breaks almost all national diactrics for latin alphabet and all of other character sets. One possible solution requires recompiling ploticus with freetype support and changing a few lines in EasyTimeline.pl and Timeline.php, and making an unicode ttf font available to the ploticus. I'll put diffs into attachments.
Created attachment 1065 [details] patch for EasyTimeline.pl
Created attachment 1066 [details] diffs for Makefile of ploticus
Recompiled ploticus requires GDFONTPATH envvar to see the ttf font. I wasn't able to figure out how to pass it to ploticus from php, so that still needs to be done. I only tested the patches from command line, so it needs to be tested. I used FreeSans.ttf, which seems to give acceptable results, but lacks kanji (it has kana though).
Created attachment 1067 [details] corrected the patch for EasyTimeline.pl, as avar suggested
See also bug 9 (... URLs with UTF-8 ...).
changed URL http://pl.wikibooks.org/w/index.php?title=Wikipedysta:Matusz/test reference by oldid http://pl.wikibooks.org/w/index.php?title=Wikipedysta:Matusz/test&oldid=11064
(In reply to comment #3) > Recompiled ploticus requires GDFONTPATH envvar to see the ttf font. I wasn't > able to figure out how to pass it to ploticus from php, so that still needs to > be done. Using putenv() ?
Created attachment 1071 [details] example intermediate file generated by EasyTimeline in order to pass it to ploticus file is gzipped - I don't quite believe bugzilla to not break the unicode in the way
the FreeSans.ttf I suggest comes from http://savannah.nongnu.org/projects/freefont/
Working on installing this stuff...
Created attachment 1085 [details] updated patch to EasyTimeline.pl this differs from previous patch just by having: . " -mapfile " . EscapeShellArg($file_htmlmap) appended to the cmdline, so that ploticus 2.32 generates mapfile to the correct file (it defaults to stdout)
Applied latest patch live. Now generates the imagemaps, but links to pages with non-ASCII chars are badly broken. http://pl.wikibooks.org/w/index.php?title=Wikipedysta:Matusz/test&oldid=11249
Created attachment 1086 [details] Updated patch for EasyTimeline.pl including fix for URLs This version also fixes URLs for links with UTF-8 characters. For some reason, EasyTimeline internally uses an encoding similar to URL encoding, in the form %XX% where X is a hex digit. This is decoded just before the scripts are written out to intermediate files; the decoding process was thus decoding the first byte of a URL-encoded sequence and removing the % for the second byte, leaving it nastily corrupt. Fix is to output %25% from EncodeURL instead of %, so it decodes correctly at output time. Also I forced it to 2-digit hex output (shouldn't happen, but for safety on chars 0-f...) and told it to not encode '_'.