Re: URLEncode vs ParamsEncode

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

StringA  := 'http://?/'; <--- ? is a chinese character, which should be %E4%B8%80

> Here is a simple program, using URLEncode and ParamsEncode to prepare http m
> essage.
> 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

None

In response to

URLEncode vs ParamsEncode posted by Gloria on Wed, 6 Jun 2007