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

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top