Question

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 @'

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top