function EnCodeURL(const RawURL: string): string;
var
WURL: WideString;
AChar: string;
i: Integer;
begin
Result := '';
WURL := RawURL;
for i := 1 to Length(WURL) do
begin
AChar := WURL;
if Length(AChar) > 1 then // 汉字
Result := Format('%s%%%2x%%%2x', [Result, Ord(AChar[1]), Ord(AChar[2])])
else if AChar = ' ' then
Result := Format('%s%%%2x', [Result, Ord(AChar[1])])
else
Result := Result + AChar;
end;
end;