中文乱码问题

传输过来是乱码

post

request.setCharacterEncoding("utf-8");

get

new String(request.getParameter("name").getBytes("iso-8859-1"),"utf-8");

ie6

URLEncoder.encode("发送字符","utf-8");

显示在浏览器上乱码

浏览器用utf-8解析

response.setContentType("text/html;utf-8");

你可能感兴趣的:(中文乱码问题)