cleanEscapes removes URL escapes as per IETF 2386 RFP.
StringWriter theStringWithoutEscape = new StringWriter();
for( int i = 0; i < stringToDecode.length(); i++ ) {
char c = stringToDecode.charAt( i ) ;
if( c != '%" ) {
theStringWithoutEscape.write( c );
} else {
// Get the two hexadecimal digits and convert that into int
i++;
int Hex1 = hexOf( stringToDecode.charAt(i) );
i++;
int Hex2 = hexOf( stringToDecode.charAt(i) );
int value = (Hex1 * 16) + Hex2;
// Convert the integer to ASCII
theStringWithoutEscape.write( (char) value );
}
}
return theStringWithoutEscape.toString();