function URLEncode(const message : String) : String;
var
I : Integer;
begin
Result := '';
for I := 1 to Length(message ) do begin
if message [I] = ' ' then
Result := Result + '+'
else if message [I] in ['a'..'z', 'A'..'Z', '0'..'9'] then
Result := Result + message [I]
else
Result := Result + '%' + IntToHex(ord(message [I]), 2);
end;
end;
var
I : Integer;
begin
Result := '';
for I := 1 to Length(message ) do begin
if message [I] = ' ' then
Result := Result + '+'
else if message [I] in ['a'..'z', 'A'..'Z', '0'..'9'] then
Result := Result + message [I]
else
Result := Result + '%' + IntToHex(ord(message [I]), 2);
end;
end;