Bug 47122

Summary: Hyperlinks to a directory containing a %20 space are not correctly handled
Product: Fop - Now in Jira Reporter: Trejkaz (pen name) <trejkaz>
Component: pdfAssignee: fop-dev
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: trunk   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Sample files
Sample files without proper URL encoding
possible fix (for PDF output)

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