java判断字符串是什么编码,然后转换成中文:response.setContentType("text/html;charset=utf-8"); request.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8"); String name=Tool.ObjToStr(request.getParameter("name"), "美国"); if(name.equals(new String(name.getBytes("iso8859-1"), "iso8859-1"))){ name=new String(request.getParameter("name").getBytes("iso8859-1"),"utf-8"); }
新闻热点
疑难解答