摘要:
各种各样的乱码的解决方法总结。对于Java,由于默认的编码方式是UNICODE,所以用中文也易出问题,常见的解决是:Strings2=newString(s1.getBytes(“ISO-8859-1”),”GBK”);1、utf8解决JSP中文乱码问题一般说来在每个页面的开始处,加入:<%@pagelanguage="java"contentType="text/html;charset=UTF-8"pageEncoding="UTF-8"%><%request.setCharacterEncoding(" 阅读全文
摘要:
1 public class Enum { 2 public enum Spiciness { 3 YOU, ME, HE, SHE, HER, YOUS 4 } 5 public Enum(Spiciness degree){ 6 this.degree=degree; 7 } 8 9 Spiciness degree;10 11 public void describe() {12 switch (degree) {13 case YOU:System.out.pri... 阅读全文
摘要:
<% String search = null; String stu = request.getParameter("stu"); String select_stu = request.getParameter("select_stu"); select_stu=new String(select_stu.getBytes("ISO-8859-1"),"utf-8"); if ("Xno... 阅读全文