HttpServletRequest – req.getParamter("")
默认:默认采用ISO-8859-1编码表
修改:req.setCharacterEncoding(“utf-8”)
HttpServletResponse – resp.getWriter.write("")
默认:默认采用ISO-8859-1编码表
修改:resp.setCharacterEncoding(“utf-8”)
str.getBytes()
默认:默认采用ISO-8859-1编码表
修改:str.getBytes(“utf-8”)
String str=new String(bytes)
默认:默认采用ISO-8859-1编码表
修改:String str=new String(bytes,"UTF-8")