function StringToCode(const AStr: string): string;var i: Integer; p: pChar;begin p := pChar(AStr); while p^<>#0 do begin if Result<>'' then Result := Result + '%' + IntToHex(ord(p^), 2) else Result := Result + '%' + IntToHex(ord(p^), 2); Inc(p); end;end;