XML中对特殊字符的处置
str = str.replaceAll("‘", "‘");
str = str.replaceAll("’", "‘");
str = str.replaceAll("“", "”");
str = str.replaceAll("”", "”");
str = str.replaceAll("—", "—");
str = str.replaceAll("¢","¢");
str = str.replaceAll("£","£");
str = str.replaceAll("¤","¤");
str = str.replaceAll("¥","¥");
str = str.replaceAll("¦","|");
str = str.replaceAll("§","§");
str = str.replaceAll("¨","¨");
str = str.replaceAll("ª","a");
str = str.replaceAll("­","-");
str = str.replaceAll("¯","ˉ");
str = str.replaceAll("°","°");
str = str.replaceAll("±","±");
str = str.replaceAll("µ","μ");
str = str.replaceAll("·","·");
str = str.replaceAll("¹","1");
str = str.replaceAll("º","o");
str = str.replaceAll("×","×");
str = str.replaceAll("÷","÷");
str = str.replaceAll("…","…");
str = str.replaceAll("‾"," ̄");
str = str.replaceAll("←","←");
str = str.replaceAll("↑","↑");
str = str.replaceAll("→","→");
str = str.replaceAll("↓","↓");
str = str.replaceAll("∏","∏");
str = str.replaceAll("∑","∑");
str = str.replaceAll("√","√");
str = str.replaceAll("∝","∝");
str = str.replaceAll("∞","∞");
str = str.replaceAll("∠","∠");
str = str.replaceAll("∧","∧");
str = str.replaceAll("∨","∨");
str = str.replaceAll("∩","∩");
str = str.replaceAll("∪","∪");
str = str.replaceAll("∫","∫");
str = str.replaceAll("∴","∴");
str = str.replaceAll("∼","~");
str = str.replaceAll("≈","≈");
str = str.replaceAll("≠","≠");
str = str.replaceAll("≡","≡");
str = str.replaceAll("≤","≤");
str = str.replaceAll("≥","≥");
str = str.replaceAll("⊕","?");
str = str.replaceAll("⊥","⊥");
str = str.replaceAll("–","–");
str = str.replaceAll("—","—");
str = str.replaceAll("‰","‰");
str = str.replaceAll("€","?");
str = str.replaceAll("À","à");
str = str.replaceAll("Á","á");
str = str.replaceAll("È","è");
str = str.replaceAll("É","é");
str = str.replaceAll("Ê","ê");
str = str.replaceAll("Ì","ì");
str = str.replaceAll("Í","í");
str = str.replaceAll("Ð","D");
str = str.replaceAll("Ò","ò");
str = str.replaceAll("Ó","ó");
str = str.replaceAll("Ù","ù");
str = str.replaceAll("Ú","ú");
str = str.replaceAll("Ü","ü");
str = str.replaceAll("Ý","Y");
str = str.replaceAll("Þ","T");
str = str.replaceAll("à","à");
str = str.replaceAll("á","á");
str = str.replaceAll("â","a");
str = str.replaceAll("è","è");
str = str.replaceAll("é","é");
str = str.replaceAll("ê","ê");
str = str.replaceAll("ì","ì");
str = str.replaceAll("í","í");
str = str.replaceAll("ð","e");
str = str.replaceAll("ò","ò");
str = str.replaceAll("ó","ó");
str = str.replaceAll("ù","ù");
str = str.replaceAll("ú","ú");
str = str.replaceAll("ü","ü");
str = str.replaceAll("ý","y");
str = str.replaceAll("þ","t");
str = str.replaceAll("Α","Α");
str = str.replaceAll("Β","Β");
str = str.replaceAll("Γ","Γ");
str = str.replaceAll("Δ","Δ");
str = str.replaceAll("Ε","Ε");
str = str.replaceAll("Ζ","Ζ");
str = str.replaceAll("Η","Η");
str = str.replaceAll("Θ","Θ");
str = str.replaceAll("Ι","Ι");
str = str.replaceAll("Κ","Κ");
str = str.replaceAll("Λ","Λ");
str = str.replaceAll("Μ","Μ");
str = str.replaceAll("Ν","Ν");
str = str.replaceAll("Ξ","Ξ");
str = str.replaceAll("Ο","Ο");
str = str.replaceAll("Π","Π");
str = str.replaceAll("Ρ","Ρ");
str = str.replaceAll("Σ","Σ");
str = str.replaceAll("Τ","Τ");
str = str.replaceAll("Υ","Υ");
str = str.replaceAll("Φ","Φ");
str = str.replaceAll("Χ","Χ");
str = str.replaceAll("Ψ","Ψ");
str = str.replaceAll("Ω","Ω");
str = str.replaceAll("α","α");
str = str.replaceAll("β","β");
str = str.replaceAll("γ","γ");
str = str.replaceAll("δ","δ");
str = str.replaceAll("ε","ε");
str = str.replaceAll("ζ","ζ");
str = str.replaceAll("η","η");
str = str.replaceAll("θ","θ");
str = str.replaceAll("ι","ι");
str = str.replaceAll("κ","κ");
str = str.replaceAll("λ","λ");
str = str.replaceAll("μ","μ");
str = str.replaceAll("ν","ν");
str = str.replaceAll("ξ","ξ");
str = str.replaceAll("ο","ο");
str = str.replaceAll("π","π");
str = str.replaceAll("ρ","ρ");
str = str.replaceAll("σ","σ");
str = str.replaceAll("τ","τ");
str = str.replaceAll("υ","υ");
str = str.replaceAll("φ","φ");
str = str.replaceAll("χ","χ");
str = str.replaceAll("ψ","ψ");
str = str.replaceAll("ω","ω");
str = str.replaceAll("´","?");
str = str.replaceAll("©","?");
str = str.replaceAll("µ","?");
str = str.replaceAll("®","?");
str = str.replaceAll("°","°");
str = str.replaceAll("¡","?");
str = str.replaceAll("»","?");
str = str.replaceAll("¦","?");
str = str.replaceAll("÷","÷");
str = str.replaceAll("¿","?");
str = str.replaceAll("¬","?");
str = str.replaceAll("§","§");
str = str.replaceAll("•","?");
str = str.replaceAll("½","?");
str = str.replaceAll("«","?");
str = str.replaceAll("¶","?");
str = str.replaceAll("¨","¨");
str = str.replaceAll("¸","?");
str = str.replaceAll("¼","?");
str = str.replaceAll("±","±");
str = str.replaceAll("×","×");
str = str.replaceAll("¢","?");
str = str.replaceAll("¾","?");
str = str.replaceAll("¯","?");
str = str.replaceAll("™","?");
str = str.replaceAll("€","?");
str = str.replaceAll("£","?");
str = str.replaceAll("¥","?");
str = str.replaceAll("„","?");
str = str.replaceAll("…","…");
str = str.replaceAll("·","·");
str = str.replaceAll("›","?");
str = str.replaceAll("ª","?");
str = str.replaceAll("ˆ","?");
str = str.replaceAll("º","?");
str = str.replaceAll("†","?");
str = str.replaceAll("‹","?");
str = str.replaceAll("‚","?");
str = str.replaceAll("‰","‰");
str = str.replaceAll("­","?");
str = str.replaceAll("˜","?");
str = str.replaceAll("≈","≈");
str = str.replaceAll("⁄","?");
str = str.replaceAll("←","←");
str = str.replaceAll("∂","?");
str = str.replaceAll("♠","?");
str = str.replaceAll("∩","∩");
str = str.replaceAll("≥","≥");
str = str.replaceAll("≤","≤");
str = str.replaceAll("∑","∑");
str = str.replaceAll("♣","?");
str = str.replaceAll("⇔","?");
str = str.replaceAll("◊","?");
str = str.replaceAll("′","′");
str = str.replaceAll("↑","↑");
str = str.replaceAll("↓","↓");
str = str.replaceAll("♥","?");
str = str.replaceAll("−","?");
str = str.replaceAll("∏","∏");
str = str.replaceAll("‍","?");
str = str.replaceAll("♦","?");
str = str.replaceAll("∞","∞");
str = str.replaceAll("≠","≠");
str = str.replaceAll("√","√");
str = str.replaceAll("‌","?");
str = str.replaceAll("≡","≡");
str = str.replaceAll("∫","∫");
str = str.replaceAll("‾","?");
str = str.replaceAll("→","→");
str = str.replaceAll("α","α");
str = str.replaceAll("η","η");
str = str.replaceAll("μ","μ");
str = str.replaceAll("π","π");
str = str.replaceAll("θ","θ");
str = str.replaceAll("β","β");
str = str.replaceAll("γ","γ");
str = str.replaceAll("ν","ν");
str = str.replaceAll("ψ","ψ");
str = str.replaceAll("υ","υ");
str = str.replaceAll("χ","χ");
str = str.replaceAll("ι","ι");
str = str.replaceAll("ω","ω");
str = str.replaceAll("ρ","ρ");
str = str.replaceAll("ξ","ξ");
str = str.replaceAll("δ","δ");
str = str.replaceAll("κ","κ");
str = str.replaceAll("ο","ο");
str = str.replaceAll("σ","σ");
str = str.replaceAll("ζ","ζ");
str = str.replaceAll("ε","ε");
str = str.replaceAll("λ","λ");
str = str.replaceAll("φ","φ");
str = str.replaceAll("τ","τ");
str = str.replaceAll("Α","Α");
str = str.replaceAll("Η","Η");
str = str.replaceAll("Μ","Μ");
str = str.replaceAll("Π","Π");
str = str.replaceAll("Θ","Θ");
str = str.replaceAll("Β","Β");
str = str.replaceAll("Γ","Γ");
str = str.replaceAll("Ν","Ν");
str = str.replaceAll("Ψ","Ψ");
str = str.replaceAll("Υ","Υ");
str = str.replaceAll("Χ","Χ");
str = str.replaceAll("Ι","Ι");
str = str.replaceAll("Ω","Ω");
str = str.replaceAll("Ρ","Ρ");
str = str.replaceAll("Ξ","Ξ");
str = str.replaceAll("Δ","Δ");
str = str.replaceAll("Κ","Κ");
str = str.replaceAll("Ο","Ο");
str = str.replaceAll("Σ","Σ");
str = str.replaceAll("Ζ","Ζ");
str = str.replaceAll("Ε","Ε");
str = str.replaceAll("Λ","Λ");
str = str.replaceAll("Φ","Φ");
str = str.replaceAll("Τ","Τ");
str = str.replaceAll("ς","?");
参考原文:http://www.myexception.cn/xml-soap/1049053.html
XML中对特殊字符的处置的更多相关文章
- xml中处理特殊字符和转义字符
XML 中的特殊字符 > 和 开始标记 > 例如: 5 ]] 如何获得这些HTML内容呢? XmlDocument doc = new XmlDocument(); doc.Load(&q ...
- (转载)ANDROID STRINGS.XML 中的特殊字符转义
今天项目碰到个转义特殊字符的问题,网上搜索看到,故转载,已标明出处: 项目中要在string.xml 中显示特殊符号.如@号冒号等.直接写肯定不行啦 只能考虑使用ASCII码进行显示.在XML中空格符 ...
- Mybatis中的XML中需要用到的转义符号整理
使用这么久的Mybatis中需要转义的符号整理一下,小结一下: 1. < 小于符号 < 2. <= 小于等于 ...
- EasyPlayerPro Windows播放器读取xml配置文件中的特殊字符问题
问题被反馈 今日一客户反馈说播放不了带用户名密码的流, 奇怪,这个问题不存在啊-,按照客户的说法, 是将url地址保存在配置文件中,然后再打开EasyPlayerPro运行: 问题复现 在EasyPl ...
- XML中& <> 单引号' 双引号 " 报错
由于xml中 这些字符是特殊字符,所以把&改成& 就行了 ,注意后面一定要带一个分号; < < 小于号> > ...
- 【python】mysqlDB转xml中的编码问题
背景:有mysql数据库,将数据从数据库中读取,并存储到xml中 采用了MySQLdb和lxml两个库 具体编码处理过程如下: . 指定mysql的编码方式 .取数据库data->判断data类 ...
- web.xml中JSP配置及 EL表达式
web.xml 中JSP配置.servlet配置 及 EL表达式 [摘要] servlet 基本配置 <servlet> <servlet-name>LoginServlet& ...
- [转]XML中必须进行转义的字符
转自:http://jaenson.iteye.com/blog/945469 编写XML代码经常遗漏的常识: XML实体中不允许出现"&","<" ...
- (转)XML中必须进行转义的字符
场景:在工作中接触到很多xml文件,为了更好的操作这些文件,所有很有必要熟知xml文件的相关语义. 1 引入 编写XML代码经常遗漏的常识: XML实体中不允许出现"&", ...
随机推荐
- PHP扩展迁移为兼容PHP7记录
PHP7扩展编写的时候,提供的一些内核方法和之前的PHP之前的版本并不能完全兼容.有不少方法参数做了调整.下面是在迁移过程中遇到的一些问题.记录下来,避免大家再踩坑. PHP7扩展开发之hello w ...
- ASP.NET MVC的处理管线
原文:http://www.cnblogs.com/fzrain/p/3651693.html 下面开始解释各个部分: 路由模块 1.在ASP.NET MVC处理管线中的第一站就是路由模块.当请求到达 ...
- 【基本算法】 KMP文本串模式串的字符串匹配算法
看了两个晚上的KMP,加上基本的“暴力匹配” 今晚看懂next[j]递归求解时,突然觉得算法真的好美妙,虽然觉悟的晚但晚胜过没有是吧! 我的博客都是应试性的学习笔记,不具备指导性,还是大神们写的好,例 ...
- delphi 中几种多线程操作方式
在了解多线程之前我们先了解一下进程和线程的关系 一个程序至少有一个主进程,一个进程至少有一个线程. 为了保证线程的安全性请大家看看下面介绍 Delphi多线程同步的一些处理方案大家可以参考:http: ...
- JavaScript文件应该放在网页的什么位置
JavaScript文件应该放在网页的什么位置 http://www.lihuai.net/qianduan/js/352.html 在<良好的JavaScript编程习惯>系列教程的第三 ...
- [C++]内存字节对齐
当我们写一个class类,然后sizeof(),然后发现这个值往往比你想象的大,这是为什么呢?这里就要讲到内存对齐的问题. 先来看一下内存对齐的几条原则: 1.对于class(struct/union ...
- PHP 判断是否包含某字符串
PHP语言是一个功能强大的嵌入式HTML脚本语言,它的易用性让许多程序员选择使用.PHP判断字符串的包含,可以使用PHP的内置函数 strstr,strpos,stristr直接进行判断.也可以通过e ...
- POJ 3335 Rotating Scoreboard(半平面交求多边形核)
题目链接 题意 : 给你一个多边形,问你在多边形内部是否存在这样的点,使得这个点能够看到任何在多边形边界上的点. 思路 : 半平面交求多边形内核. 半平面交资料 关于求多边形内核的算法 什么是多边形的 ...
- 最近在看 ASP.NET 5,有关官方实现的 OAuth 2 包
有了官方实现的 OAuth 2 包,再扩展到国内就方便多了(懒得找第三方). 官方实现的有关授权和验证的包:https://github.com/aspnet/Security 根据这些,我就扩展了几 ...
- Log4net学习
转自:http://www.cnblogs.com/sirkevin/archive/2012/06/13/2548449.html Log4net简介根据日志类别保存到不同的文件,并按照日期生成不同 ...