码迷,mamicode.com
首页 > 其他好文 > 详细

输出中文乱码的处理

时间:2017-06-07 00:43:57      阅读:157      评论:0      收藏:0      [点我收藏+]

标签:编码   eth   type   response   设置   缓冲   简化   ace   har   

 * 字节流:

     * 设置浏览器默认打开的编码:

        * resposne.setHeader(Content-Type,text/html;charset=UTF-8);

     * 设置中文字节取出的时候编码.

        * 中文.getBytes(UTF-8);

 * 字符流:

     * 设置浏览器打开的时候的编码

        * resposne.setHeader(Content-Type,text/html;charset=UTF-8);

     * 设置response的缓冲区的编码

        * response.setCharacterEncoding(UTF-8);

 

***** 简化的写法:response.setContentType(text/html;charset=UTF-8);

输出中文乱码的处理

标签:编码   eth   type   response   设置   缓冲   简化   ace   har   

原文地址:http://www.cnblogs.com/lijingbo/p/6954143.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!