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中对特殊字符的处置的更多相关文章

  1. xml中处理特殊字符和转义字符

    XML 中的特殊字符 > 和 开始标记 > 例如: 5 ]] 如何获得这些HTML内容呢? XmlDocument doc = new XmlDocument(); doc.Load(&q ...

  2. (转载)ANDROID STRINGS.XML 中的特殊字符转义

    今天项目碰到个转义特殊字符的问题,网上搜索看到,故转载,已标明出处: 项目中要在string.xml 中显示特殊符号.如@号冒号等.直接写肯定不行啦 只能考虑使用ASCII码进行显示.在XML中空格符 ...

  3. Mybatis中的XML中需要用到的转义符号整理

    使用这么久的Mybatis中需要转义的符号整理一下,小结一下: 1.       <         小于符号        < 2.       <=       小于等于     ...

  4. EasyPlayerPro Windows播放器读取xml配置文件中的特殊字符问题

    问题被反馈 今日一客户反馈说播放不了带用户名密码的流, 奇怪,这个问题不存在啊-,按照客户的说法, 是将url地址保存在配置文件中,然后再打开EasyPlayerPro运行: 问题复现 在EasyPl ...

  5. XML中& <> 单引号' 双引号 " 报错

    由于xml中 这些字符是特殊字符,所以把&改成&  就行了 ,注意后面一定要带一个分号; <         <         小于号>         >  ...

  6. 【python】mysqlDB转xml中的编码问题

    背景:有mysql数据库,将数据从数据库中读取,并存储到xml中 采用了MySQLdb和lxml两个库 具体编码处理过程如下: . 指定mysql的编码方式 .取数据库data->判断data类 ...

  7. web.xml中JSP配置及 EL表达式

    web.xml 中JSP配置.servlet配置 及 EL表达式 [摘要] servlet 基本配置 <servlet> <servlet-name>LoginServlet& ...

  8. [转]XML中必须进行转义的字符

    转自:http://jaenson.iteye.com/blog/945469 编写XML代码经常遗漏的常识: XML实体中不允许出现"&","<" ...

  9. (转)XML中必须进行转义的字符

    场景:在工作中接触到很多xml文件,为了更好的操作这些文件,所有很有必要熟知xml文件的相关语义. 1 引入 编写XML代码经常遗漏的常识: XML实体中不允许出现"&", ...

随机推荐

  1. Coder-Strike 2014 - Finals (online edition, Div. 2) C题

    C. Online Meeting time limit per test 1 second memory limit per test 256 megabytes input standard in ...

  2. ios7.1 在线安装 失败的解决办法

    昨天升级7.1之后,证书制作的app就无法在线安装了,各种搜..说需要https.搭web服务器,起https服务,结果不行.终于明白,https需要权威认证,自己搭建的不行,需要买第三方权威机构的认 ...

  3. CSS 的overflow:hidden 属性详细解释

    overflow:hidden这个CSS样式是大家常用到的CSS样式,但是大多数人对这个样式的理解仅仅局限于隐藏溢出, 而对于清除浮动这个含义不是很了解.一提到清除浮动,我们就会想到另外一个CSS样式 ...

  4. Codeforces Round #258 (Div. 2)(A,B,C,D)

    题目链接 A. Game With Sticks time limit per test:1 secondmemory limit per test:256 megabytesinput:standa ...

  5. 为什么toString方法可以用来区分数组和对象?

    首先大家都应该知道在javascript中只有是对象都存在toString方法,将调用该方法的值转换为字符串返回,如下: var arr = [1, 2, 3]; console.log(arr.to ...

  6. java多线程浅谈

    当一个线程进入一个对象的一个synchronized方法后,其它线程是否可进入此对象的其它方法? 分这几种情况:    1.其他方法前是否加了synchronized关键字,如果没加,则能.    2 ...

  7. linux环境几个特殊的shell变量

    特殊的shell变量: $0  获取当前执行的shell脚本的文件名 $n  获取当前执行的shell脚本的第n个参数值,n=1..9 $*  获取当前shell的所有参数 “$1 $2 $3 …注意 ...

  8. 怎样在java代码中调用执行shell脚本

    // 用法:Runtime.getRuntime().exec("命令"); String shpath="/test/test.sh"; //程序路径 Pro ...

  9. UML元素分析

  10. Samba 服务使用的端口和协议(是一组TCP UDP协议的组合,主要使用CIFS协议,有一个Java例子)

    Samba服务所使用的端口和协议: 1)Port 137 (UDP) - NetBIOS 名字服务 : nmbd 2)Port 138 (UDP) - NetBIOS 数据报服务 3)Port 139 ...