.net - Invalid XML characters -
i have text file(utf-8) file. content of file extracted form rich text documents, might ms word, pdf, html or thing. have pass content web service, of time contain invalid characters form feed or null. happens when pass content of file, containing invalid character, web service throw exception (not valid xml character).
as found few characters not valid xml can have proper .net function clean string , remove invalid characters or can have list of invalid characters authentic site.
thanks in advance.
if it's important send file's content without modification best decision escape content. if it's not, try use xmlconvert.isxmlchar method, helps check character's correctness. check this answer code samples.
Comments
Post a Comment