---
title: "Birt通过url传参遇到中文出现乱码的解决办法"
author: "lpzhouyang"
date: "2009-01-12T15:21:06Z"
tags: []
slug: "birt-url"
draft: false
lastmod: "2009-01-12T15:21:06Z"
id: 315083
url: "https://lpzhouyang.iteye.com/blog/315083"
---

通过url传参遇到中文出现乱码的解决办法
前提：
1.使用eclipse提供的runtime viewer.
2.使用超链方式查看报表．
3.使用tomcat.

具体解决办法：
修改tomcat的server.xml文件，在Connector元素中增加属性useBodyEncodingForURI="true"
并且，url中的中文参数必须事先转码.
eg:
String param=java.net.URLEncoder.encode("公用信息表","UTF-8");
<a href="../birt/frameset?__report=privilegerpt.rptdesign¶m=<%=param%>">查看</a>
即ok.