xml 中如果包含部分 ascii 控制字符(小数字)则 chrome会报告如下类型错我:

This page contains the following errors:
error on line 20 at column 89: Input is not proper UTF-8, indicate encoding !
Bytes: 0x08 0xE8 0xBA 0xB2
Below is a rendering of the page up to the first error.

解决办法:replace 这些字符

 public static string ReplaceXMLInvaidChar(string xmlStr)
{
return Regex.Replace(xmlStr, "[\x00-\x1F\x7F]",""); }

  

原因:XML 规范不支持如下字符
#x0 - #x8 (ASCII 0 - 8)
#xB - #xC (ASCII 11 - 12)
#xE - #x1F (ASCII 14 - 31)

参看文档:https://support.microsoft.com/en-us/kb/315580

原文地址:https://blog.csdn.net/isaisai/article/details/53899089

Input is not proper UTF-8, indicate encoding !错误处理的更多相关文章

  1. php加载xml编码错误,“Error: Input is not proper UTF-8, indicate encoding! ”

    最近在给php中解析xml的时候,抛出一个错误: "Warning: DOMDocument::load(): Input is not proper UTF-8, indicate enc ...

  2. 十二 INPUT逻辑视图的配置,回显错误信息

    Action接口中提供了五个逻辑视图的名称 SUCCESS ERROR LOGIN INPUT:input在某些拦截器会使用 NONE 配置逻辑视图:struts_demo2.xml,配置后出现错误信 ...

  3. 【转载】解决 Subversion 的 “svn: Can't convert string from 'UTF-8' to native encoding” 错误

    转载自:http://blog.csdn.net/shaohui/article/details/3996274 在google code 上创建了一个新的项目, 用Windows 下面的tortoi ...

  4. SAS使用SPD引擎并报Encoding错误

     ERROR: Unable to open data file because its file encoding differs from the SAS session encoding and ...

  5. UnSupported Encoding错误

    学习struts2的时候碰到tomcat报错:org.apache.jasper.JasperException: Unsupported encoding:  UTF-8,原因是jsp文件中的pag ...

  6. Zend Studio出现 Some characters cannot be mapped using "GBK" character encoding 错误

    解决办法: Window->Profermance->General->Content Types->Text看目录下面的每个文件,包括子目录里面 Default encodi ...

  7. Python input 使用

    Python 3.0 中使用"input" , Python 2.0 中使用"raw_input"Python 3.5: #!C:\Program Files\ ...

  8. 已解决】Sublime中运行带input或raw_input的Python代码出错:EOFError: EOF when reading a line(转)

    [问题] 在折腾: [已解决]Sublime Text 2中运行Python程序出错:The system cannot find the file specified 的过程中,虽然解决了找不到py ...

  9. node进阶| 解决表单enctype="multipart/form-data" 时获取不到Input值的问题

    今天在学习node踩到一个坑:form设置enctype="multipart/form-data"上传文件时,无法获取到表单其他input的值. 因为之前上传文件用的是 form ...

随机推荐

  1. 备注信息的textarea 和 数据库 text类型

    有时候需要用到备注信息 备注一些东西 但是它又不同于普通的输入框,要有换行啊 空格之类的,更有甚者还有其他更多的需求 1.更多需求 用富文本编辑器 2.普通需求 直接用input type=" ...

  2. Java基础--序列化Serializable

    对Java对象序列化的目的是持久化对象或者为RMI(远程方法调用)传递参数和返回值. 下面是一个序列化对象写入文件的例子: ---------------------------- package u ...

  3. (转)更改Web.config中对上传文件大小限制

    .net上传超过200K的图片的时候,会跳转到404,但是url没有错误,真J8的坑啊. 本文转载自:http://www.cnblogs.com/zwffff/archive/2009/04/29/ ...

  4. SOAP webserivce 和 RESTful webservice 对比及区别

    简单对象访问协议(Simple Object Access Protocol,SOAP)是一种基于 XML 的协议,可以和现存的许多因特网协议和格式结合使用,包括超文本传输协议(HTTP),简单邮件传 ...

  5. QT5 地图的使用

    https://blog.csdn.net/qq_28877125/article/details/80561829 博客园地址 资源下载地址: https://download.csdn.net/d ...

  6. 使用Fiddler进行iOS APP的HTTP/HTTPS抓包

    Fiddler不但能截获各种浏览器发出的HTTP请求, 也可以截获各种智能手机发出的HTTP/HTTPS请求.Fiddler能捕获IOS设备发出的请求,比如IPhone, IPad, MacBook. ...

  7. 如何设置select下拉禁止选择

    转自:https://blog.csdn.net/you23hai45/article/details/52233207

  8. 简单cpu web flask mysql

    转:http://blog.csdn.net/u010663768/article/details/60632133 python 2.7 cpu入库 #!/usr/bin/python # -*- ...

  9. jQuery的AJax异步加载

    主要用到load()方法以及getScript()方法,具体以一个例子说明: 在现有html文件中加载一个拟好的片段,以及在片段加载完成之前阻止用户进一步操作的弹出框. 首先是现有html代码,无任何 ...

  10. 5-EasyNetQ之Publish(黄亮翻译)

    EasyNetQ支持的最简单的消息模式是发布/订阅.这个模式是一个极好的方法用来解耦消息提供者和消费者.消息发布者只要简单的对世界说,"这里有些事发生" 或者 "我现在有 ...