<%! public static string decode (string s, string eNCoding) throws exception {
StringBuffer SB = new stringbuffer ();
For (int i = 0; i
CHAR C = S.Charat (i);
Switch (c) {
Case ' ':
sb.append ('');
Break;
Case '%':
Try {
sb.append ((char) integer.parseint
S.SUBSTRING (i 1, i 3), 16));
}
Catch (NumberFormatexception E) {
Throw new illegalargumentException ();
}
i = 2;
Break;
DEFAULT:
Sb.append (c);
Break;
}
}
// undo conversion to external encoding
String result = sb.toString ();
Byte [] INPUTBYTES = Result.getbytes ("8859_1"); // Web container with ISO8859_1 encoding method of HTTP GET / POST parameter
Return New String (InputBytes, Encoding);
}
%>