---
title: "转码相关代码"
author: "xiaxingwork"
date: "2014-12-24T18:07:40Z"
tags: []
categories: ["移动开发"]
slug: "untitled"
draft: false
lastmod: "2014-12-24T18:07:40Z"
id: 2169850
url: "https://xiaxingwork.iteye.com/blog/2169850"
---

在要传参数的地方写：

&lt;%=java.net.URLEncoder.encode("中文参数","GB2312")%&gt;

 

在获取参数的地方：

String ssxt=java.net.URLDecoder.decode(request.getParameter("ssxt"),"GB2312");

ssxt = new String(ssxt.getBytes("ISO-8859-1"), "utf-8");

 

&lt;%=URLDecoder.decode(zbmc,"GBK")%&gt;

 

编解码详解

http://blog.csdn.net/xiongchao2011/article/details/7276834