URLEncode vs ParamsEncode

Giganews Newsgroups
Subject: URLEncode vs ParamsEncode
Posted by:  Gloria (gloria.…@gmail.com)
Date: Wed, 6 Jun 2007

Here is a simple program, using URLEncode and ParamsEncode to prepare http message.
But I find the results are not the same!

Can I know why? Thanks!

Gloria Ho

----------
procedure TForm1.Button1Click(Sender: TObject);
var
  StringA  : String;
  UTF8Value: UTF8String
begin
  StringA  := 'http://?/';
  UTF8Value := utf8Encode(StringA);
  showmessage( TidURI.ParamsEncode(UTF8Value) );  { result is "http://%E4%B8?/" }
  showmessage( TidURI.URLEncode(UTF8Value) );  { result is "http://%E4%B8%80/" }
end;

Replies