我哭啊,应用环境是java 1.3 我使用的开发环境,从1.5换到1.4.2,现在又不能用了
使用replaceAll 替换特殊字符在1.4.2编译通过,在1.3中又找不到方法,不能使用,自己拷进去,Pattern又找不到,我晕了
这是什么世道.

解决方案 »

  1.   

    why 1.3???!!!!!!!!!!!!!Thou shalt know 1.6 is avaliable!
      

  2.   

    FYI.question 1 : 
       seems you can't use CDATA in atrribue , so,maybe you need replace the following character(you may use a filter to filter atrribute value before you set attribute value) :
     There are 5 predefined entity references in XML(from w3c):
     &lt;  <  less than
     &gt;  >  greater than
     &amp;  &  ampersand 
     &apos; '  apostrophe
     &quot; "  quotation  question 2 :  if you add encode declaration as following when your servlet generate xml file
      <?xml version="1.0" encoding="UTF-8"?> 
      IE will employ UTF-8 decode , there should be no problem as you said above.
      

  3.   

    谢谢两位了.回:shine333(enihs)
     我做的是IBM Lotus开发,使用的是 Domino6.5.3该版本的JAVA版本使用的是JAVA1.3
    这是我改变不了的,只能去适应回:heyulin()
     question 1 : 无奈之下,我也想这么做,可是JVM版本太低,replaceAll 方法涉及到的东西太多,我没弄懂,没法自己加进去,自己写,没有那个实力
     question 2 :对于编码格式还是不怎么懂 使用UTF-8 Print出来提示我编码格式不对自己的解决方法:
    使用JS中的escape方法(按规则自己写)对需要编码的串进行,输出,在Web页打印前进行unescape
    虽然这样做还有个别字符不通,但基本符合需求.有什么好的意见建议,欢迎提出来
      

  4.   

    二進制數據用base64編碼
    ' " < > &等就用替換好了