标签:enc override htm charset bsp tty rac ted 添加
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
// 。。。。处理[添加一些参数]
resp.setContentType("text/html;charset=utf-8");
req.setCharacterEncoding("utf-8");
String name = req.getParameter("name");
PrintWriter writer = resp.getWriter();
name = new String(name.getBytes("ISO-8859-1"), "utf-8");
String txt = "测试成功";
writer.print(txt);
}
标签:enc override htm charset bsp tty rac ted 添加
原文地址:http://www.cnblogs.com/sunshinekevin/p/7189844.html