Tuesday, June 10, 2014

URLDecoder: Illegal hex characters in escape (%) pattern

Posting so I can find this easily next time, maybe even I'll remember typing this up.

With Railo (4.2+) and MySQL, I used a generated password that contained a percent sign (%) in the value.  For example:

    thisIsA%Password%Sample

The problem is that Railo attempts to use "URL decoding" on it, like converting %20 to a space, as you've likely seen before.

After a search online, I ran across this StackOverflow article.  To sum it up, you need to pre-escape the % sign for yourself, if you're unable to change the password for some reason.

The above password becomes this now:

    thisIsA%25Password%25Sample

Pretty simple, but a tricky item to encounter.

- Will Belden
June 10, 2014