I have a text file(UTF-8) file. Content of this file is extracted form rich text documents, it might be MS Word, PDF, HTML or any thing. I have to pass this content to a web service, but most of time it contain invalid characters like form feed or null. What happens now is when I pass the content of the file, containing invalid character, to the web service it throw exception (not a valid XML character).
As I found few characters that are not valid for XML but can I have a proper .NET function the clean the string and remove all invalid characters or can I have a list of Invalid characters for any authentic site.
Thanks for your help in advance.