Bug 47122 - Hyperlinks to a directory containing a %20 space are not correctly handled
Summary: Hyperlinks to a directory containing a %20 space are not correctly handled
Status: NEW
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: pdf (show other bugs)
Version: trunk
Hardware: All All
: P3 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-29 16:41 UTC by Trejkaz (pen name)
Modified: 2012-04-07 01:52 UTC (History)
0 users



Attachments
Sample files (9.40 KB, application/x-zip-compressed)
2009-04-29 16:41 UTC, Trejkaz (pen name)
Details
Sample files without proper URL encoding (9.39 KB, application/x-zip-compressed)
2009-04-29 16:45 UTC, Trejkaz (pen name)
Details
possible fix (for PDF output) (1.61 KB, patch)
2009-07-21 03:13 UTC, Andreas L. Delmelle
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Trejkaz (pen name) 2009-04-29 16:41:40 UTC
Created attachment 23563 [details]
Sample files

Attached zip file contains two FO files which are intended to link to each other's PDF after generation.

The directories contain spaces, thus the url has %20 in it.  However, on conversion to PDF, FOP appears to have mangled the URL somehow so that it no longer works.
Comment 1 Trejkaz (pen name) 2009-04-29 16:45:11 UTC
Created attachment 23564 [details]
Sample files without proper URL encoding

Attaching sample files which use an un-encoded space instead of %20, demonstrating that this works correctly for some reason.
Comment 2 Trejkaz (pen name) 2009-07-19 18:21:45 UTC
I just tried this on Foxit Reader, which exhibits the problem in the same way.
Comment 3 Andreas L. Delmelle 2009-07-21 03:12:04 UTC
Apologies for the late reply.

Issue checked and confirmed with FOP Trunk. I'll attach a small patch (for Trunk) fixing the issue. 
It seems that PDF expects the URI to be decoded. Not entirely sure, as I don't have the PDF spec handy at the moment, but I seem to remember that the % sign is also used for PDF escapes, which may be an explanation.
Comment 4 Andreas L. Delmelle 2009-07-21 03:13:51 UTC
Created attachment 24012 [details]
possible fix (for PDF output)


This small patch fixes the issue, at least for PDF. I haven't checked whether this is also a problem for the AWT renderer...
Comment 5 Andreas L. Delmelle 2009-07-21 04:39:07 UTC
Note: patch was a bit too quick. Encoding the URI in URIAction.toSAX() caused a testcase to fail...
Comment 6 Glenn Adams 2012-04-07 01:44:35 UTC
resetting P2 open bugs to P3 pending further review