Team,
I've got a problem parsing special characters in XML. I was given a really badly formatted XML file that has a bunch of special characters - majority of these look like "squares" in notepad.
I've already tried a bunch of different thing like setting the Encoding type to "UTF-8" and also inserting the "<?xml version="1.0" encoding="UTF-8"?>" line as the first line in the document.
To set the encoding programmatically I did this by setting the StreamReader's property for encoding to UTF-8. Then, I use this to write XML data a file that I later load using the .Load() function. But this is where it tanks. It says - unrecognized character found which is the square like character. I can delete this character if I want - this is totally upto me. But how do I do this? How do I recognize that the character read in the stream was the square looking character and then delete?
Any help would be much appreciated. Thanks.
there can be no pact between lions and men...
http://ireuben.net