Last modified: 2005-11-19 06:23:24 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T5965, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 3965 - EasyTimeline does not handle unicode characters above 7e properly
EasyTimeline does not handle unicode characters above 7e properly
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
EasyTimeline (Other open bugs)
unspecified
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Brion Vibber
http://pl.wikibooks.org/w/index.php?t...
:
Depends on:
Blocks: unicode 4046
  Show dependency treegraph
 
Reported: 2005-11-14 22:11 UTC by Piotr Matuszewski
Modified: 2005-11-19 06:23 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
patch for EasyTimeline.pl (1.46 KB, patch)
2005-11-14 22:11 UTC, Piotr Matuszewski
Details
diffs for Makefile of ploticus (1.23 KB, patch)
2005-11-14 22:12 UTC, Piotr Matuszewski
Details
corrected the patch for EasyTimeline.pl, as avar suggested (1.25 KB, patch)
2005-11-14 22:22 UTC, Piotr Matuszewski
Details
example intermediate file generated by EasyTimeline in order to pass it to ploticus (1.50 KB, application/octet-stream)
2005-11-15 21:34 UTC, Piotr Matuszewski
Details
updated patch to EasyTimeline.pl (1.30 KB, patch)
2005-11-19 01:49 UTC, Piotr Matuszewski
Details
Updated patch for EasyTimeline.pl including fix for URLs (1.91 KB, patch)
2005-11-19 06:16 UTC, Brion Vibber
Details

Description Piotr Matuszewski 2005-11-14 22:11:07 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.
Comment 1 Piotr Matuszewski 2005-11-14 22:11:53 UTC
Created attachment 1065 [details]
patch for EasyTimeline.pl
Comment 2 Piotr Matuszewski 2005-11-14 22:12:30 UTC
Created attachment 1066 [details]
diffs for Makefile of ploticus
Comment 3 Piotr Matuszewski 2005-11-14 22:21:07 UTC
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). 
Comment 4 Piotr Matuszewski 2005-11-14 22:22:48 UTC
Created attachment 1067 [details]
corrected the patch for EasyTimeline.pl, as avar suggested
Comment 5 Zigger 2005-11-14 22:46:26 UTC
See also bug 9 (... URLs with UTF-8 ...).
Comment 7 Ævar Arnfjörð Bjarmason 2005-11-15 21:26:21 UTC
(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() ?
Comment 8 Piotr Matuszewski 2005-11-15 21:34:37 UTC
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
Comment 9 Piotr Matuszewski 2005-11-17 10:00:35 UTC
the FreeSans.ttf I suggest comes from

http://savannah.nongnu.org/projects/freefont/
Comment 10 Brion Vibber 2005-11-18 22:54:12 UTC
Working on installing this stuff...
Comment 11 Piotr Matuszewski 2005-11-19 01:49:46 UTC
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)
Comment 12 Brion Vibber 2005-11-19 04:08:34 UTC
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
Comment 13 Brion Vibber 2005-11-19 06:16:44 UTC
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 '_'.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links