Delphi: function to convert a string in a url-read

2020-05-09 19:25发布

Possible Duplicate:
Standard URL encode function?

I need to transofrm a Delphi string (like TEdit.Caption) in a "url capable" string.

I need this because I will open google maps programmatically like in TEdit I write "High Street, Sydney"

and then i would like to open the browser at maps.google.com/maps?q=High+Street+Sidney

Is there a ready function to do this, also to parse accents?

标签: delphi url
1条回答
做自己的国王
2楼-- · 2020-05-09 19:53

You can add IdURI unit from Indy to your uses clause, and use TIdURI.URLEncode() method to encode a URL, and TIdURI.Decode() to decode an encoded URL to a normal string.

查看更多
登录 后发表回答