大家来看看,关于dojo中文编码的问题!!!!!!! url中的中文先转码下 再传递 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 希望不是太晚/* * Created on Sep 26,2008 * * Copyright by 布谷鸟 */package encode;import java.util.StringTokenizer;/** * * @Author <a href="[email protected]">cuckoo</a> * @Time 14:14 * @Description 转换编码 */public class TransferEncode { public static void main(String args[]) { String str = "布谷鸟"; System.out.println("--"+unicode2String(str)); } private static String unicode2String(String unicode){ StringBuffer buff = new StringBuffer(); StringTokenizer token = new StringTokenizer(unicode,";"); String temp = null; String newTemp = null; while(token.hasMoreTokens()){ temp = token.nextElement().toString(); newTemp = temp.replaceAll("&#", ""); buff.append((char)Integer.parseInt(newTemp, 10)); } return buff.toString(); }}------------------------------------------------------Quietly through.... 我用的是strust2标签显示的 你这个怎么使用啊 请教一个struts2中struts.xml的配置问题,谢谢 java 小错误 osworkflow如何调用自己定义的类呢 急。。。。。。。。在线等啊?? jsp怎么导出另存XML文件 JPS 有哪几个版本,很幼稚的问题,心情好,散分? attachClean与attachDirty和merge axis下怎么样传递ArrayList类型的参数,在线等待 用axis时一个特别奇怪的问题 请用struts开发过实际项目的朋友进来说说 j2ee学习 java.lang.NumberFormatException: For input string: "" 如何解决
* Created on Sep 26,2008
*
* Copyright by 布谷鸟
*/
package encode;import java.util.StringTokenizer;/**
*
* @Author <a href="[email protected]">cuckoo</a>
* @Time 14:14
* @Description 转换编码
*/
public class TransferEncode { public static void main(String args[]) {
String str = "布谷鸟";
System.out.println("--"+unicode2String(str));
} private static String unicode2String(String unicode){
StringBuffer buff = new StringBuffer();
StringTokenizer token = new StringTokenizer(unicode,";");
String temp = null;
String newTemp = null;
while(token.hasMoreTokens()){
temp = token.nextElement().toString();
newTemp = temp.replaceAll("&#", "");
buff.append((char)Integer.parseInt(newTemp, 10));
}
return buff.toString();
}
}
------------------------------------------------------
Quietly through....