hexadecimal value 0x0C, is an invalid character-如何去除XML无效字符
2009-10-29 15:12
393 查看
下面写了一个C#函数,去除XML无效字符:
public static string CleanInvalidXmlChars(string text) { // From xml spec valid chars: // #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] #x2 // any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. string re = @"[^/x09/x0A/x0D/x20-/xD7FF/xE000-/xFFFD/x10000-x10FFFF]"; return Regex.Replace(text, re, ""); }
相关文章推荐
- hexadecimal value 0x0C, is an invalid character-如何去除XML无效字符
- XML hexadecimal value 0x__, is an invalid character
- Dom4j 读 xml 时,遇到 xml 无效字符,报错:An invalid XML character
- Dom4j 读 xml 时,遇到 xml 无效字符,报错:An invalid XML character
- '<', hexadecimal value 0x3C, is an invalid attribute character. Line 21, position 29.
- XmlDocument的Load方法报“hexadecimal value .., is an invalid character”
- XML文件处理过程中的0x1A 错误处理,Hexadecimal value 0x is an invalid character
- INVALID_CHARACTER_ERR: 指定的 XML 字符无效或非法。
- XmlDocument的Load方法报“hexadecimal value .., is an invalid character”
- XML解析出现An invalid XML character (Unicode: 0x**) was found in the comment.
- SAXParseException An invalid XML character 问题的解决
- 处理编译错误"0" is an invalid value for the "DebugInformation" parameter of the "DCC" task.
- Error parsing XML: An invalid XML character (Unicode:0x1f) was found
- SAXParseException An invalid XML character 问题的解决
- HTTP Status 500 - An invalid character [44] was present in the Cookie value
- org.springframework.dao.InvalidDataAccessApiUsageException: ERR value is not an integer or out of ra
- org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x7)
- java.lang.IllegalArgumentException: An invalid character [32] was present in the Cookie value
- 处理编译错误"0" is an invalid value for the "DebugInformation" parameter of the "DCC"
- an error occurred while signing: '.', hexadecimal value 0x00, is an invalid character