这段代码怎么理解? 就是使用新的编码,把源字符串重新编码输出 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public class test { public static void main(String[] args) { String strEn = "May be you're right."; String strZN = "也许你是对的。"; System.out.println(ISO8859_1_Encoder(strEn)); System.out.println(ISO8859_1_Encoder(strZN)); System.out.println(ISO8859_1_Encoder(strEn+strZN)); } private static String ISO8859_1_Encoder(String src){ String strEncoded = null; byte[] tmpbyte; try{ tmpbyte=src.getBytes("ISO8859_1"); strEncoded=new String(tmpbyte); } catch(Exception e){ } return strEncoded; }} org.apache.tomcat.util.http.Parameters processParameters 异步加载页面 java 读取图片大小 测试本机运行的网站,然后出现了一大堆异常信息:请高手帮帮我吧 axis2简单的web service问题 调用远程ejb后出现与本地ejb冲突问题 session和cookie的问题 jsp的老问题 我用javabean的时候为什么会出错? javascript与jsp 有何区别? 在 resin 下 javabean 应该放在哪里? 关于图片上传的例子!我是刚才学JSP,请高手帮我!谢谢
public static void main(String[] args) {
String strEn = "May be you're right.";
String strZN = "也许你是对的。";
System.out.println(ISO8859_1_Encoder(strEn));
System.out.println(ISO8859_1_Encoder(strZN));
System.out.println(ISO8859_1_Encoder(strEn+strZN));
} private static String ISO8859_1_Encoder(String src){
String strEncoded = null;
byte[] tmpbyte;
try{
tmpbyte=src.getBytes("ISO8859_1");
strEncoded=new String(tmpbyte);
}
catch(Exception e){
}
return strEncoded;
}
}