Form input encoding problem
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Henry_Leung
Posted On:   Friday, August 22, 2003 12:58 AM

I am using Websphere 4.0 AE (i.e. using servlet 2.2 ). I need to input Chinese character in a html form. But the servlet that handles the submitted request cannot interpret the received parameter correctly. I read some articles on the forums here and used the following code to try to decode the parameters by myself: String paramname = new String(request.getParameter("paramname").getBytes("ISO8859_1"),"UTF-8"); It works, but not for all the cases. I found that sometimes the encoding is not ISO8859_1 and request.getCharacterEncoding simply returns null to me...... Any solution?    More>>

I am using Websphere 4.0 AE (i.e. using servlet 2.2 ). I need to input Chinese character in a html form. But the servlet that handles the submitted request cannot interpret the received parameter correctly. I read some articles on the forums here and used the following code to try to decode the parameters by myself:



			
String paramname = new String(request.getParameter("paramname").getBytes("ISO8859_1"),"UTF-8");





It works, but not for all the cases. I found that sometimes the encoding is not ISO8859_1 and request.getCharacterEncoding simply returns null to me......



Any solution?    <<Less
About | Sitemap | Contact