str = str.replaceAll("‘", "‘");
str = str.replaceAll("’", "‘");
str = str.replaceAll("“", "”");
str = str.replaceAll("”", "”");
str = str.replaceAll("—", "—");
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. IE6下div遮盖select的最优解决方案

    a.本节精选html5/css频道里一款IE6下div遮盖select的最优解决方案 原理:利用iframe来遮挡select,再用div来遮挡iframe,就这么简单. 1)首先,建一个div层和i ...

  2. 远程数据源Combobox

    Ext.define('bookInfo', {          extend: 'Ext.data.Model',//新类继承自model          fields: [{ name: 'b ...

  3. 下拉菜单得经典写法html5

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  4. 几种CPU架构

    原文链接:http://blog.csdn.net/wyzxg/article/details/5027738 这几天在下载RPM包的时候,总会看见x86,x86-64,IA64,i386,i586等 ...

  5. uva 11374

    Problem D: Airport Express In a small city called Iokh, a train service, Airport-Express, takes resi ...

  6. Oracle MySQL

    http://blog.jobbole.com/46510/ http://blackproof.iteye.com/blog/1570456 http://blog.csdn.net/yzsind/ ...

  7. ExtJs之Ext.util.TaskRunner

    <!DOCTYPE html> <html> <head> <title>ExtJs</title> <meta http-equiv ...

  8. powermockito “mock public 方法内部 Private方法的问题”

    我需要测试的方法是 public 方法: public ResponseResult subscribe(SysSubscription sysSubscription) throws JsonGen ...

  9. JavaWeb笔记——利用过滤器实现页面静态化

    1.说明 页面静态化是把动态页面生成的html保存到服务器的文件上,然后再有相同请求时,不再去执行动态页面,而是直接给用户响应上次已经生成的静态页面. * 核心思路为拦截请求,实现请求转发指向静态页面 ...

  10. AlarmManager.RTC和ELAPSED_REALTIME的区别

    AlarmManager.RTC,硬件闹钟,不唤醒手机(也可能是其它设备)休眠:当手机休眠时不发射闹钟. AlarmManager.RTC_WAKEUP,硬件闹钟,当闹钟发躰时唤醒手机休眠: Alar ...