Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem with URLDecoder.decode(s, enc)

843840Apr 1 2008 — edited Jul 10 2008
Hi!

I'm having problems with the URLDecoder.decode(s, enc) method... When I send a string, encoded with the Javascript escape() function, to the server side of my application, I get a problem decoding it using this:
myString = URLDecoder.decode(myString, "iso-8859-1");
It gives me this error: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "u2"

My html defines the encoding as follows:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
The string being submitted contains a special apostrophe ( ' ) copy/pasted from MS Word wich then translates it as %u2019 (what's that??? Unicode???).

Can anyone tell me what is happening? How can I encode / decode this properly?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 7 2008
Added on Apr 1 2008
1 comment
490 views