`
jaychang
  • 浏览: 718142 次
  • 性别: Icon_minigender_1
  • 来自: 嘉兴
社区版块
存档分类
最新评论

XML中对特殊字符的处理

    博客分类:
  • 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("ς","?");

 

分享到:
评论

相关推荐

    解析XML特殊字符方法

    解析XML特殊字符方法有二种 XML特殊字符XML特殊字符XML特殊字符XML特殊字符XML特殊字符XML特殊字符XML特殊字符XML特殊字符XML特殊字符XML特殊字符XML特殊字符XML特殊字符

    mybatis xml中特殊字符处理及特殊符号

    主要介绍了mybatis xml中特殊字符处理及mybatis特殊符号处理技巧,mybatis特殊符号处理给大家介绍了两种写法,感兴趣的朋友一起看看吧

    xml转javaBean,javaBean转xml,xml标签大小写问题,以及对xml特殊符号的处理

    xml转javaBean,javaBean转xml,xml标签大小写问题,CDATA的生成,以及对xml特殊符号的处理

    C# XML字符串包含特殊字符的处理转换方法小结

    为了能正常输出XML格式的内容,必须要对不被XML允许的那些特殊字符进行转换。本文介绍的正是如何使用C#判断XML字符串是否含特殊字符并进行转换。 以下是几个特殊字符的对应实体。 < <  小于号 &...

    xml 的特殊字符的处理方法

    在xml中,有一些符号作为XML 的标记符号,一些特定情况下,属性值必须带有这些特殊符号。 下面主要是讲解一些常用的特殊符号的处理

    Mybatis自定义拦截器,对模糊查询传值的特殊字符统一进行转义处理的代码

    特殊字符(\,_,%)转义工具类 MyQueryInterceptor.java: Mybatis自定义拦截器 注意:该拦截器只支持QueryWrapper的like方法,serviceImpl层传全角模糊查询(%%) mapper或xml层的全角模糊查询(%*%)和半角模糊查询(%*或*%)

    Mybatis自定义拦截器,对模糊查询传值的特殊字符(\,_,%)统一进行转义处理的代码

    代码包含: EscapeUtil.java:特殊字符(\,_,%)转义工具类 MyQueryInterceptor.java: Mybatis自定义拦截器 注意:该拦截器只支持QueryWrapper的like方法,serviceImpl层传全角模糊查询(%%) mapper或xml层的全角模糊查询(%...

    Mybatis特殊字符处理的详解

    Mybatis特殊字符处理,Mybatis中xml文件特殊字符的处理,这里提供了解决办法及实例,大家可以参考下: 一、问题描述: 查询时,需要获取时间区间内的数据,如下: and l.CREATE_TIME >= #{startTime} and l....

    xml和web特殊字符

    在html和xml文件中,往往会因为以下特殊字符而导致文件解析出错,一般通过以下函数来处理。

    C++ xml文件处理介绍

    一个完整的xml编程指南,有了它xml文件文件编程完全不是问题

    XStream:Object与Xml字符串 互相转换

    XStream:Object与Xml字符串 互相转换 多个同名子节点以及节点属性的处理

    论文研究-电子病例共享系统中XML文档处理方法的研究 .pdf

    电子病例共享系统中XML文档处理方法的研究,宁晓,杜军平,以一个开发完成的电子病例共享系统为平台,在从XML文档的解析,超大XML文档的生成、XML文档的切割以及XML文档中特殊和非法字符处理等

    xml内容解析,包含命名空间时需特殊处理(dom4j)

    NULL 博文链接:https://superich2008.iteye.com/blog/1750287

    xml入门教程/xml入门教程

    7)注意特殊字符,使用时需要使用转义字符。 注意: 1.第一行一定要写<?xml verson="1.0"?> 2.xml文件是由元素和元素的内容以及属性组成的,一个xml文件中只能有一个根元素,标签和标签的内容加在一起叫作一个元素。...

    xml入门经典-part3(中文版)

    4.1.5 动态建模:对数据进行哪些处理? 4.2 设计XML文档 4.2.1 XML的两种角色 4.2.2 将信息模型映射到XML 4.3 模式语言和表示法 4.3.1 模式的作用 4.3.2 将DTD作为模式 4.3.3 XML模式建议 4.4 小结 第5章 ...

    XML高级编程pdf

    4.1.5 动态建模:对数据进行哪些处理? 4.2 设计XML文档 4.2.1 XML的两种角色 4.2.2 将信息模型映射到XML 4.3 模式语言和表示法 4.3.1 模式的作用 4.3.2 将DTD作为模式 4.3.3 XML模式建议 4.4 小结 第5章 ...

    Tinyxml 源代码(VC6 & VS2005)

    TinyXML认得预定义的特殊“字符实体”,即: & & > > " " ' ‘ 这些在XML文档读取时都会被辨认出来,并会被转化成等价的UTF-8字符。比如下面的XML文本: Far & Away 从TiXmlText 对象查询出来时会...

    XML 高级编程(高清版)

    4.1.5 动态建模:对数据进行哪些处理? 4.2 设计XML文档 4.2.1 XML的两种角色 4.2.2 将信息模型映射到XML 4.3 模式语言和表示法 4.3.1 模式的作用 4.3.2 将DTD作为模式 4.3.3 XML模式建议 4.4 小结 第5章 ...

    XML高级编程 (Extensible Markup Language)

    4.1.5 动态建模:对数据进行哪些处理? 4.2 设计XML文档 4.2.1 XML的两种角色 4.2.2 将信息模型映射到XML 4.3 模式语言和表示法 4.3.1 模式的作用 4.3.2 将DTD作为模式 4.3.3 XML模式建议 4.4 小结 第5章 ...

Global site tag (gtag.js) - Google Analytics