TStringBuilder result = new TStringBuilder();
TByteArrayOutputStream out = new TByteArrayOutputStream();
for (int i = 0; i < s.length();) {
char c = s.charAt(i);
if (c == '%') {
out.reset();
do {
if (i + 2 >= s.length()) {
throw new TIllegalArgumentException();
}
int d1 = TCharacter.digit(s.charAt(i + 1), 16);