Help - resetting parameters in request
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Puneet_Dh
Posted On:   Thursday, November 6, 2003 07:50 AM

We have a problem with character encoding for Chinese user. Looks like when they are trying to connect to our system and have parameters in their URL, it is giving a "Unsupported Encoding [cp 1386] " error. One of the solution I found was to read bytes, convert to UTF-8 to String using: String utf8 = new String(request.getParameter("yourtextbox").getBytes("ISO8859_1"), "UTF-8"). I have couple of questions on this solution: 1) Do I have to individually convert for all the parameters in the URL to UTF-8 to String. 2) Secondly, once I get a parameter from request and convert it to UTF-8 to String, how do I again set it back in the request. Since I want to do this in a framework class, once I   More>>
			We have a problem with character encoding for Chinese user. Looks like when they are trying to connect to our system and have parameters in their URL, it is giving a "Unsupported Encoding [cp 1386] " error. One of the  solution I found was to read bytes, convert to UTF-8 to String using:
			
String utf8 = new String(request.getParameter("yourtextbox").getBytes("ISO8859_1"), "UTF-8").
I have couple of questions on this solution:

1) Do I have to individually convert for all the parameters in the URL to UTF-8 to String.
2) Secondly, once I get a parameter from request and convert it to UTF-8 to String, how do I again set it back in the request. Since I want to do this in a framework class, once I convert all parameters, I want to set them back in the request object to be used later, I am not sure how to do that?
I know there is a setAttribute() method but what about parameters??

Is there any other way of doing this?


Any help is greatly appreciated.
Thanks.
   <<Less
About | Sitemap | Contact