---
title: "URL上中文传参乱码解决方案"
author: "280395291"
date: "2013-04-17T09:46:54Z"
tags: []
categories: ["Web前端"]
slug: "url"
draft: false
lastmod: "2013-04-17T09:46:54Z"
id: 1848643
url: "https://280395291.iteye.com/blog/1848643"
---

 第一步：在tomcat下的server.xml文件中添加URIEncoding="UTF-8";

 第二步：在传递中文前使用URLEncoder.encoder(String str,String charset)方法编码。在接收方使用URLDecoder.decoder(String str,String charset)方法进行解码。

