Some of my wide strings contains characters escaped with &# For example: The wide string source looks like: '   ' The converted result must be ' ' (3 blank spaces).

Function should look like

function UriUnescape(const aSrc: WideString): WideString;
begin
  //Your code goes here
end;

Note: 1) I am using Delphi 7.

2) This wide string is part of a SOAP response not HTML.

3) In general this method should accept alphanumeric characters as part of the wide string: example input :='be @' result := 'be @'

有帮助吗?

解决方案

Your C# link is about URL unescaping but your source string looks more like HTML encoded. In that case, see HtmlDecode function in HttpApp unit.

If you want URL decoding you could try HttpDecode or Indy's TIdURL.URLDecode.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top