str = str.replaceAll("‘", "‘");
str = str.replaceAll("’", "‘");
str = str.replaceAll("“", "”");
str = str.replaceAll("”", "”");
str = str.replaceAll("—", "—");
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. Sqli-labs less 22

    Less-22 本关和less20.less21是一致的,我们可以从源代码中看到这里对uname进行了"uname"的处理,可以构造payload: admin1"and ...

  2. PHP7安装笔记

    PHP7安装笔记 时间 -- :: 喵了个咪 原文 http://www.hdj.me/php7-install-note 主题 PHP # 安装mcrypt yum install -y php-m ...

  3. Delphi中@,^,#,$特殊符号意义

    概述:   ^: 指针   @: 取址   #: 十进制符   $: 十六进制符   @:取址运算符; var   int:integer;   p:^integer; begin   new(P); ...

  4. delphi 网络函数

    Delphi网络函数 unit net; interfaceusessysutils,windows,dialogs,winsock,classes,comobj,wininet; //得到本机的局域 ...

  5. 传说中的WCF(3):多个协定

    我们知道,WCF服务端是先定义服务协定,其实就是一个接口,然后通过实现接口来定义服务类.那么,有一个问题,如果一个服务类同时实现N个接口(也就是有N个协定)呢?结果会如何? 不必猜,我们还是通过实验来 ...

  6. lintcode:买卖股票的最佳时机 II

    买卖股票的最佳时机 II 假设有一个数组,它的第i个元素是一个给定的股票在第i天的价格.设计一个算法来找到最大的利润.你可以完成尽可能多的交易(多次买卖股票).然而,你不能同时参与多个交易(你必须在再 ...

  7. lintcode:数字组合 II

    数字组合 II 给出一组候选数字(C)和目标数字(T),找出C中所有的组合,使组合中数字的和为T.C中每个数字在每个组合中只能使用一次. 注意事项 所有的数字(包括目标数字)均为正整数. 元素组合(a ...

  8. HTTP返回码总结

    HTTP协议状态码表示的意思主要分为五类,大体是:  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~  1×× 保留  2×× 表示请求成功地接收  3×× 为完成请求客户需进一步细化请求  ...

  9. Gravitational Teleport 是一个先进的 SSH 服务器,基于 Golang SSH 构建,完全兼容 OpenSSH

    Gravitational Teleport 是一个先进的 SSH 服务器,可通过 SSH 或者 HTTPS 远程访问 Linux 服务器.其目的是为了替代 sshd.Teleport 可以轻松让团队 ...

  10. iOS Architecture

    目前ios的指令集有以下几种: armv6 iPhone iPhone2 iPhone3G 第一代和第二代iPod Touch armv7 iPhone4 iPhone4S armv7s iPhone ...