字符集:Unicode,字符编码:UTF-8

UTF-8:一个字节0SXSXSXS

二个字节:110SXSXS 10SXSXSX

三个字节:1110SXSX 10SXSXSX 10SXSXSX

由于unicode不兼容gb2312等等字符集编码,那么需要codepage来映射,

Gb2312codepage936

Unicodecodepoage65001

1)post乱码:在调用request.getParameter之前调用,request.setCharacterEncoding("UTF-8"),或者增加一个过滤器,加请求参数进行字符编码过滤

2)get乱码:设置tomcat服务器配置文件server.xml在context中增加一个属性URIEncoding="UTF-8"

3)jsp页面内编辑时:在右上角ISO-8859-1改成UTF-8或者在window->preference->myeclipse->files and editor->jsp改成UTF-8这样新建的jsp都是UTF-8

4)*.properties文件中文乱码:native2ascii.exe或者用myeclipse的properties文件编辑器即可

相关文章:

  • 2021-10-10
  • 2021-08-28
  • 2022-01-20
  • 2021-11-27
  • 2022-12-23
  • 2022-02-26
  • 2022-02-23
  • 2022-02-10
猜你喜欢
  • 2021-08-16
  • 2021-04-16
  • 2021-06-11
  • 2022-12-23
  • 2022-01-10
  • 2022-12-23
相关资源
相似解决方案