╰☆把酒言欢
                               聪明出于勤奋,天才在于积累.

package com.rf.demo;   
 
import org.apache.commons.lang.StringEscapeUtils;
 
/**  
 * 替换HTMl里面的字符 e.g.: < > " å И 水  
 *   
 * @author ivan.yan
 */  
public class EscapeUtils {   
 
  public static void main(String[] args) {
      String s = "中文转字符的HTML实体表示形式";
      System.out.println(StringEscapeUtils.escapeHtml(s));
      
      
      String u = "&#20013;&#25991;&#36716;&#23383;&#31526;&#30340;HTML&#23454;&#20307;&#34920;&#31034;&#24418;&#24335;";
      System.out.println(StringEscapeUtils.unescapeHtml(u));
      
  }
}

posted on 2013-05-20 23:04  把酒言欢  阅读(20866)  评论(0编辑  收藏  举报