Neil Aggarwal wrote:
Hello:

When I encode the name of an image file to place into a URL, I use this
code:

URLEncoder.encode(imageName,"UTF-8")

This gives me image names with spaces replaced by + signs which IE does not
like.
If I change the spaces to %20, the URL works perfectly in IE.

For example, if my image name is Ping G2 Driver.gif, URLEncoder gives me
this URL:
 <http://dev.rentclubs.com/~maryanne/images/clubs/Driver/Ping+G2+Driver.gif>
http://dev.rentclubs.com/~maryanne/images/clubs/Driver/Ping+G2+Driver.gif

If I try to load this URL in IE, it gives me a 404 error.

If I use the exact same url with %20, it works just fine:
<http://dev.rentclubs.com/~maryanne/images/clubs/Driver/Ping%20G2%20Driver.g
if>
http://dev.rentclubs.com/~maryanne/images/clubs/Driver/Ping%20G2%20Driver.gi
f

I thought + and %20 were both acceptable for spaces in a URL, but apparently
IE does not like the plus signs. Is there a way to force URLEncoder to use %20 instead of + signs?

Nope. '+' is canonical and should work fine. What encoding are you sending your pages with? That's the only thing I can think of that might make a difference.

L.
--
Laurie, Open Source advocate, Java geek and novice blogger:
http://www.holoweb.net/laurie


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to