• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

URLDecoder.decode problem

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

i am trying to decode the string which as escape char and it gives me error as "URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "u2""

here is string which i am trying to decode "ss%27sd%20ds%20sdsd%u2019sds%20dfsf%20". and the escape char which i am getting error is "%u2019".


thank you,
Mahesh
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As the error message says, the input string is not a valid URL encoded string. Where does the input string come from? It looks like something was done incorrectly in the encoding.

After the %, there should be hexadecimal digits. 'u' is not a valid hexadecimal digit, so it complains.

If you intended to encode the Unicode character U+2019, then the URL encoded version should have looked like this: %E2%80%99
(which is U+2019 in UTF-8 encoding, and then percent-escaped).
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic