---
title: "SpringMVC中文参数乱码处理类"
author: "江雨行"
date: "2014-07-17T11:05:43Z"
tags: []
categories: ["非技术"]
slug: "springmvc"
draft: true
lastmod: "2014-07-17T11:05:43Z"
id: 2093076
url: "https://yuxinglab.iteye.com/blog/2093076"
---

```
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;  
        }  
    }  
}  
```