在java中怎么把一个字符串编译为指定编码格式(如:unicode)的输出
来源:百度知道 编辑:UC知道 时间:2024/05/21 12:07:37
很多种方法request.setCharacterEncoding("utf-8"); //设置输入编码格式
response.setContentType("text/html;charset=utf-8"); //设置输出编码格式
一般写个Servlet的过滤器
(getByte("ISO-8859-1"),"utf-8");在配置文件里面过滤.
String str = new String("abc".getBytes(),"GB2312");