Our ASP.NET (C#) application accepts form entry and saves
inputed data in XML.
We are finding that users are sometimes cutting and
pasting special characters (from MS Word) into these
forms. The data is saved successfuly, but when the XML is
later read the following error is encountered depending on
the invalid character found:
This is a sample:
System.Xml.XmlException: '', hexadecimal value 0x1A, is
an invalid character.
I have ensured that the saved XML includes an encoding
declaration (<?xml version="1.0" encoding ='UTF-8'?>).
Changing the encoding format does not effect the error
message.
The XML parser installed is MSXML 4.0.
Is there any way to handle the reading of these
characters, or any way to ensure these characters are
converted into something readable at the time the values
are written to the XML object?
Any help is greatly appreciated.