str = str.replaceAll("‘", "‘");
str = str.replaceAll("’", "‘");
str = str.replaceAll("“", "”");
str = str.replaceAll("”", "”");
str = str.replaceAll("—", "—");
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. Docker学习资料

    官方Docker:https://www.docker.com/ CSDN Docker : http://docker.csdn.net/ Docker中文社区:http://www.docker. ...

  2. js中的null VS undefined

    var a;------>undefined. JS变量的默认值.注意点在于判断变量的值为null.这是错误的.比如 if( a === null ) { // TODO; }; 实际上是und ...

  3. redis集群部署之codis 维护脚本

    搞了几天redis cluster codis 的部署安装,测试,架构优化,配合研发应用整合,这里记一些心得! 背景需求: 之前多个业务都在应用到redis库,各业务独立占用主从两台服务器,硬件资源利 ...

  4. javascript设计模式-迭代器模式(Iterator)

    <!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  5. Unity 3D 游戏上线之后的流水总结

    原地址:http://tieba.baidu.com/p/2817057297?pn=1 首先.unity 灯光烘焙 :Unity 3D FBX模型导入.选项Model 不导入资源球.Rig 不导入骨 ...

  6. Java检查型异常和非检查型异常

    1.代码 public class ExcepTest { /** * @param args */ public static void main(String[] args) { System.e ...

  7. POJ 1634 Who's the boss?

    题意: 一个员工A的直接上司是那些薪水大于A,并且身高>=A的人中薪水最少的一个. 主席CEO的薪水最高,且身高也是最高的. 有多组数据. 每组数据给出m个员工,和q个询问. 每个员工有id.薪 ...

  8. VS2010中出现无法嵌入互操作类型

    针对word或excel操作时,出现VS2010中,无法嵌入互操作类型“……”,请改用适用的接口的解决方法 问了度娘,解决方法如出一辙:选中项目中引入的dll,鼠标右键,选择属性,把“嵌入互操作类型” ...

  9. light oj 1140 - How Many Zeroes? 数位DP

    思路:dp[i][j]:表示第i位数,j表示是否有0. 代码如下: #include<iostream> #include<stdio.h> #include<algor ...

  10. linux kill命令详解

    1.命令格式: kill[参数][进程号] 2.命令功能: 发送指定的信号到相应进程.不指定型号将发送SIGTERM(15)终止指定进程.如果任无法终止该程序可用“-KILL” 参数,其发送的信号为S ...