Page MenuHomePhabricator

EasyTimeline does not handle unicode characters above 7e properly
Closed, ResolvedPublic

Assigned To
Authored By
bzimport
Nov 14 2005, 10:11 PM
Referenced Files
F2453: EasyTimeline-ttf-and-url-fix.diff
Nov 21 2014, 8:55 PM
F2452: EasyTimeline.txt.gz
Nov 21 2014, 8:55 PM
F2451: Makefile.diff
Nov 21 2014, 8:55 PM

Description

Author: gonia

Description:
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.


Version: unspecified
Severity: normal
URL: http://pl.wikibooks.org/w/index.php?title=Wikipedysta:Matusz/test&oldid=11064

Details

Reference
bz3965

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:55 PM
bzimport added a project: EasyTimeline.
bzimport set Reference to bz3965.

gonia wrote:

patch for EasyTimeline.pl

attachment EasyTimeline.pl.diff ignored as obsolete

gonia wrote:

diffs for Makefile of ploticus

Attached:

gonia wrote:

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).

gonia wrote:

corrected the patch for EasyTimeline.pl, as avar suggested

attachment EasyTimeline.pl.diff ignored as obsolete

zigger wrote:

See also bug 9 (... URLs with UTF-8 ...).

avarab wrote:

(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() ?

gonia wrote:

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

Attached:

Working on installing this stuff...

gonia wrote:

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)

attachment EasyTimeline.pl.diff ignored as obsolete

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
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 '_'.

Attached: