⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 htmldecoder.java

📁 The program is used to translate the english to chinese in the web pages just like google translate.
💻 JAVA
字号:
/* ************************************************************************** * @ Copyright 2004 by Brian Blank   										* * ************************************************************************** * Module:	$Source: /cvsroot/webtranslator/source/src/com/javanetworkframework/utils/html/HTMLDecoder.java,v $ * ************************************************************************** * Java Web Translator Project												* * http://sourceforge.net/projects/webtranslator/							* * ************************************************************************** * CVS INFORMATION															* * Current revision $Revision: 1.2 $ * On branch $Name: A0-2 $ * Latest change by $Author: xyombie $ on $Date: 2004/09/18 00:44:18 $ * ************************************************************************** * Modification History:													* * VERSION    DATE	 AUTHOR	DESCRIPTION OF CHANGE	    				    * * -------	-------- ------	------------------------------------------------* *  V1.00	09/17/04  BRB	Initial Version.								* * ************************************************************************** */package com.javanetworkframework.utils.html;import java.util.logging.Logger;/** Translates the codes in an HTMLString to it's value (ie. "&lt;" becomes "<")  *  This class should be replaced with an XML parser... */public class HTMLDecoder {	private static final Logger logger = 		Logger.getLogger(HTMLDecoder.class.getName());	/** Decodes HTML String (ie. "&lt;" becomes "<")	 * 	 * @param htmlString html string	 * @return decoded values	 */	public final static String decode(String htmlString) {		logger.entering(HTMLDecoder.class.getName(), "decode", htmlString);		if(htmlString!=null) {			htmlString = htmlString.replaceAll("&lt;", "<");			htmlString = htmlString.replaceAll("&gt;", ">");			htmlString = htmlString.replaceAll("&quot;", "\"");			htmlString = htmlString.replaceAll("&amp;", "&");			htmlString = htmlString.replaceAll("&lsquo;", "�");				htmlString = htmlString.replaceAll("&#39;", "'");		}				logger.exiting(HTMLDecoder.class.getName(), "decode", htmlString);		return htmlString;	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -