Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to deserialize XML with special characters
Message
 
 
To
All
General information
Forum:
C#
Category:
XML
Title:
How to deserialize XML with special characters
Miscellaneous
Thread ID:
01670718
Message ID:
01670718
Views:
55
UPDATE. I tried a brute approach with replacing & with _Ampersand and then back (we already had code for greater and less than signs). I also tested %, single and double quotes, but they didn't present an issue.

Can someone please post some text with non English characters so I can try it too? I guess Spanish or French would be nice as I just tried with Russian and I didn't get an error, but I got ??? instead of Russian after saving (not that I worry much anyway).

Thanks in advance.

Hi everybody,

We have code that receives result like this
<ERR>0</ERR><STATUSCODE>0</STATUSCODE><MSG>[
  {
    "BookingId": 612000001.0,
    "TransNo": 0.0,
    "Quantity": 0,
    "StartTime": "2019-08-05T11:00:00",
    "Notes": "Testing notes with special characters & < > ! =",
   ..
}]</MSG>
The json object inside the MSG tag has Notes column (and other character columns) that may contain special characters.

I tried using the code from this thread

https://stackoverflow.com/questions/4899872/fast-way-to-deserialize-xml-with-special-characters

instead of our current code, but it failed as well.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform