File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes URL encoding problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "URL encoding problem" Watch "URL encoding problem" New topic

URL encoding problem

Dean Pullen
Ranch Hand

Joined: May 30, 2003
Posts: 58
We've sent out a bunch of emails with an auto login feature.
Some of the usernames have German ASCII characters like � in 'P�per'.

It seems firefox will auto-correct this to %E4 and IE seems to do random things!

Trying to decode this using a UTF-8 decoder simply doesn't work - it just returns 'Pper' from the original 'P%E4per'.

Oddly, the automatic encoding of Japanese text seems to work fine, but these characters are just causing a complete headache within a URL.

Is there anything I can do to translate this back into ASII or UTF-8?
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

Does this mean that you are sending out e-mail messages, and they contain a URL containing the user's name, or something like that? Because if that's the case then your question is backwards. You shouldn't have to decode anything... provided you URL-encode that URL properly in the first place. I'm guessing you didn't do that.
Dean Pullen
Ranch Hand

Joined: May 30, 2003
Posts: 58
Your assumption is correct.
Obviously I'll now encode going forward, but I was trying to find a work around in the mean time.

I suspect I'll just have to resend, it only affected a few people.
I agree. Here's the link:
subject: URL encoding problem
It's not a secret anymore!