Xml problem

  • Thread starter Thread starter quest
  • Start date Start date
Q

quest

<?xml version="1.0" encoding="UTF-8"?>
<VV version="2">
</VV>

I have a simple xml as above. I posted it (using HTTP post command) from my
Win32 app ("text/xml; utf-8" specified) to http handler written in C#. To my
surprise, I am gettting something like this from my http handler :

"%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%3" which is
supposed to be :

<?xml version="1.0" encoding="UTF-8"?>

Any idea why this happen and how should I solve it ?
 
It looks like the string is HTML encoded. Pass it to
System.Web.HttpUtility.HtmlDecode() and work with the string that gets
returned.
 
Phil said:
It looks like the string is HTML encoded. Pass it to
System.Web.HttpUtility.HtmlDecode() and work with the string that
gets returned.

No. This is URL encoding. Use HttpUtility.UrlDecode().

Cheers,
 
Thanks.

Just another question. Is there anyway that we can check if a data posted to
a webserver has been URL or html encoded ?
 
Back
Top