`
江雨行
  • 浏览: 23383 次
文章分类
社区版块
存档分类
最新评论

SpringMVC中文参数乱码处理类

阅读更多
package com.yuxinglab.utils;
import java.io.UnsupportedEncodingException;

public class EncodingTool {  
    public static String encodeStr(String str) {  
        try {  
            return new String(str.getBytes("ISO-8859-1"), "UTF-8");  
        } catch (UnsupportedEncodingException e) {  
            e.printStackTrace();  
            return null;  
        }  
    }  
}  

 

分享到:
评论
发表评论

文章已被作者锁定,不允许评论。

相关推荐

Global site tag (gtag.js) - Google Analytics