Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Unable to set character encoding for URL parameters for report
Unable to set character encoding for URL parameters for report [message #250659] Wed, 01 August 2007 02:29 Go to next message
Craig Tomlyn is currently offline Craig TomlynFriend
Messages: 2
Registered: July 2009
Junior Member
Hi,
I am trying to pass some chinese text to BIRT as a parameter on the URL
for example:

http://localhost:9080/myapp/run?__report=myrep.rptdesign& ;subscriber=%E7%94%A8%E6%88%B7%E5%90%8D.

and I want to read the subscriber name inside the initialize event handler
of the report design using:
importPackage(Packages.javax.servlet.http);
var subscriber =
reportContext.getHttpServletRequest().getParameter("subscriber ");

However, after these calls, the subscriber name is not set correctly to the
Chinese text. I think this is becuase the character encoding of the request
object needs to be set to "UTF-8". However if I add the following line

request.setCharacterEncoding("UTF-8");

between the two lines above the text is still not correct. I noticed that
the description of the setCharacterEncoding() method says it cannot be
called after any parameters have been retrieved from the request object. I
assume BIRT has retrieved the report name from the request object before the
initialize event handler is called so, therefore, my setCharacterEncoding()
call is ignored and consequently the subscriber name is set incorrectly.

I was able to work arouud the problem by creating my own servlet which
sets the character encoding of the request object and then forwards the
request to BIRT's run servlet using:

request.setCharacterEncoding("UTF-8");
request.getRequestDispatcher("/run").forward(request, response);

Is there a way to solve the problem without having to introduce my own
servlet?

Thanks
Craig.
Re: Unable to set character encoding for URL parameters for report [message #1828769 is a reply to message #250659] Thu, 18 June 2020 10:41 Go to previous message
Roei Hanuka is currently offline Roei HanukaFriend
Messages: 2
Registered: June 2020
Junior Member
Hi Craig.
I faced the same problem. your workaround worked for me.
Thank you.
Previous Topic: How birt handles Khmer text
Next Topic:pdf custom font formating problem
Goto Forum:
  


Current Time: Fri Apr 19 04:27:46 GMT 2024

Powered by FUDForum. Page generated in 0.01886 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top