cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lundquist>
Subject HTTP encoding: trouble with '/'
Date Thu, 27 Apr 2006 01:17:39 GMT
Hello, me droogs...

Maybe someone can help me with this problem... I've got this Cocoon  
site, and the graphic design calls for a big block of text at the top  
of each page, in Gill Sans font with a drop-shadow effect.  OK, fine  
:-)...  I put together a pipeline that renders the text in SVG and then  
rasterizes it to a PNG using Batik... no big deal.  The text is taken  
right from the the URI, e.g.


replies with a PNG image with the text "Foo Bar" rendered as described.

Of course, the first batch of real-world content showed me the flaw in  
my approach... any "special" characters in the text would come out  
funny, and if the text contained URI metacharacters like '?', then it  
totally botched.  OK, I'm using Saxon so I can call Java directly from  
XSLT.  URLEncoder/URLDecoder to the rescue...

But not quite.  Of course, in one of the real-world pages, the text has  
a "/".  For some reason that I don't understand (being a Bear of Very  
Little Brain), running the "/" through URLEncoder gives "%25", but  
taking that back through URLDecoder does not get me my '/' back... I  
forget what it did, but whatever it was, it didn't work.  Somehow — I  
forget just how — I figured out that what I needed to get the '/' was  
"%252F".  So by this time, I've got the following in my XSLT:

     <img src="/page-heading/{replace (URLEncoder:encode (upper-case  
($text)), '%2F', '%252F')}.png"/>

Now we come to the goofy part... that is, er — the _really_ goofy part  

I have this site built in two places: (1) on my laptop, and (2) on my  
client's server.  The lash-up described above works fine on my laptop,  
but on the server, it's different!  On the server, I request this: 

and I get this:

	The requested resource "/page-heading/PRIVACY+%2F+TERMS+OF+USE.png"  
could not be found

Note, the first byte of the two-byte sequence gets eaten somehow.  But  
on my laptop, the exact same request works fine!  I've looked at it  
with _both eyes_... the squinty one, and the _really_ squinty one :-),  
and it's the same request and it works on one machine and not the  
other!  Both running OS X 10.3.something, both running the same JVM,  
and the Cocoon (2.1.8) build identical on both machines!

I'm out of ideas... anybody have any suggestions?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message