Input is not proper UTF-8, indicate encoding !错误处理
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 !错误处理的更多相关文章
- php加载xml编码错误,“Error: Input is not proper UTF-8, indicate encoding! ”
最近在给php中解析xml的时候,抛出一个错误: "Warning: DOMDocument::load(): Input is not proper UTF-8, indicate enc ...
- 十二 INPUT逻辑视图的配置,回显错误信息
Action接口中提供了五个逻辑视图的名称 SUCCESS ERROR LOGIN INPUT:input在某些拦截器会使用 NONE 配置逻辑视图:struts_demo2.xml,配置后出现错误信 ...
- 【转载】解决 Subversion 的 “svn: Can't convert string from 'UTF-8' to native encoding” 错误
转载自:http://blog.csdn.net/shaohui/article/details/3996274 在google code 上创建了一个新的项目, 用Windows 下面的tortoi ...
- SAS使用SPD引擎并报Encoding错误
ERROR: Unable to open data file because its file encoding differs from the SAS session encoding and ...
- UnSupported Encoding错误
学习struts2的时候碰到tomcat报错:org.apache.jasper.JasperException: Unsupported encoding: UTF-8,原因是jsp文件中的pag ...
- Zend Studio出现 Some characters cannot be mapped using "GBK" character encoding 错误
解决办法: Window->Profermance->General->Content Types->Text看目录下面的每个文件,包括子目录里面 Default encodi ...
- Python input 使用
Python 3.0 中使用"input" , Python 2.0 中使用"raw_input"Python 3.5: #!C:\Program Files\ ...
- 已解决】Sublime中运行带input或raw_input的Python代码出错:EOFError: EOF when reading a line(转)
[问题] 在折腾: [已解决]Sublime Text 2中运行Python程序出错:The system cannot find the file specified 的过程中,虽然解决了找不到py ...
- node进阶| 解决表单enctype="multipart/form-data" 时获取不到Input值的问题
今天在学习node踩到一个坑:form设置enctype="multipart/form-data"上传文件时,无法获取到表单其他input的值. 因为之前上传文件用的是 form ...
随机推荐
- vim直接编辑远程文件
本文由Suzzz原创,发布于http://www.cnblogs.com/Suzzz/p/4116341.html,转载请保留此声明. Linux环境下 vim scp://user@hostIP/P ...
- HIVE-执行distribute by时报错的解决过程---之如何分析hive执行的错误并解决
在执行一条HIVE语句的时候报了以下错误,重新检查了所有步骤,重启所有服务,发现没有问题. 但发现一个有趣的事情 1,select sno,sname,sex,sage,sdept from stud ...
- loj 2542 随机游走 —— 最值反演+树上期望DP+fmt
题目:https://loj.ac/problem/2542 因为走到所有点的期望就是所有点期望的最大值,所以先最值反演一下,问题变成从根走到一个点集任意一点就停止的期望值: 设 \( f[x] \) ...
- walle部署系统的使用
在项目开发的时候要管理各种开发 测试 线上环境的代码 部署 回滚等操作 这里可以使用walle walle官网:http://www.walle-web.io/ 学习安装:https://blog.c ...
- setcookie函数的注意事项
函数说明 bool setcookie ( string $name [, string $value = "" [, int $expire = 0 [, string $pat ...
- hihoCoder#1067(离线算法求LCA)
时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 上上回说到,小Hi和小Ho用非常拙劣——或者说粗糙的手段山寨出了一个神奇的网站,这个网站可以计算出某两个人的所有共同祖先中 ...
- [转] pip镜像升级报警 -trust-host问题解决方案
pip升级到7.0以后,在使用http镜像进行包安装及升级的时候往往会有如下提示: Collecting beautifulsoup4The repository located at mirrors ...
- mac 下 配置appium +ios真机环境
mac系统:10.11.6 xcode:7 appium:1.5.3 iphone: 6 p 1.搭建 appium 安卓的环境: 1.jdk 2.sdk 3.appium 4.配置环境变量 mac下 ...
- Python函数(九)-装饰器(二)
如果给被装饰器装饰的函数传递参数的话,需要在装饰器里修改 # -*- coding:utf-8 -*- __author__ = "MuT6 Sch01aR" import tim ...
- DataGrid 单元格输入验证 由ValidatingEditor事件完成
private void gdv_reguline_ValidatingEditor(object sender, DevExpress.XtraEditors.Controls.BaseContai ...