function URLDecode(psSrc: string): string; { /// URLDecode modified by Kingron, /// Support IE6 URL encode: %u3FE5%uA805test } var i: Integer; ESC: string[2]; CharCode: integer; WESC: string[4]; begin result := ''; { donot localize } psSrc := StringReplace(psSrc, '+', ' ', [rfReplaceAll]); {donot localize} i := 1; while i <= Length(psSrc) do begin if psSrc[i] <> '%'then{ donot localize } begin{donot localize} result := result + psSrc[i] end else begin Inc(i); if (psSrc[i] = 'u') and (i > 1) and (psSrc[i - 1]= '%') then begin Inc(i); WESC := Copy(psSrc, i, 4); try CharCode := StrToInt('$' + WESC); if (CharCode > 0) and (CharCode < 65536) then result := result + WideChar(CharCode); except end; Inc(i, 3); end else begin ESC := Copy(psSrc, i, 2); Inc(i, 1); try CharCode := StrToInt('$' + ESC); {donot localize} if (CharCode > 0) and (CharCode < 256) then result := result + Char(CharCode); except end; end; end; Inc(i); end; end;