org.apache.util.URIUtil.unescape does not unescape the last escaped character as it fails the length test (eg. Test%24%24 becomes Test$%24). The fix is in the patch below. --- URIUtil.cvs.java 2002-07-24 20:37:41.000000000 +0100 +++ URIUtil.java 2002-07-24 20:37:52.000000000 +0100 @@ -340,7 +340,7 @@ int ox = 0; while (ix < len) { byte b = bytes[ix++]; // Get byte to test - if ((b == '%') && (ix+2 < len)) { + if ((b == '%') && (ix+2 <= len)) { b = (byte) ((convertHexDigit(bytes[ix++]) << 4) + convertHexDigit(bytes[ix++])); }
Seems to be outdated. Please check and resubmit if not :)