中文乱码的处理

项目环境设置

服务器处理jsp文件字符集设置

工作空间文件字符集设置

get提交字符集设置

使用new String()重构字符串

在Server.xml文件中设置URIEncoding

post提交字符集设置

使用new String()重构字符串

使用request.setCharaEncoding()

    设置字符集

cookie等其他未转换

汉字的情况

使用URLEncoder和URLDecoder

    转换汉字

设置工作空间

设置tomcat 中server.xml

<connertor="2000".......     URIEconding="UTF-8">

cookie 中不支持中国文 转化方法

URLEnconding.encode("中文"); 解码:URLDecoder.decode(字符串);

 使用 request.setChar..

        response.setChar..

原文地址:https://www.cnblogs.com/wanghongjie/p/4536341.html