Hi,

I am trying to add international charset support to a JSP based application.
Have a jsp generated form where the client can input some text in a field. Name of 
the field being "text1".  
A servlet is supposed to read the data and store it.
How am I reading the stuff?  as follows
String text = new String(rq.getParameter("text1").getBytes("ISO-8859-1"), "utf-8" 
);
                //dumping bytes here
                for (int ii = 0 ; ii< text.length(); ii++)
                {
                  System.out.println("  text bytes " + Integer.toHexString(text.charAt(ii)));
                }

But even here at this initial stage with no other operations being carried out the 
byte dump shows garbage.

I have tried a lot of different ways and means but to no use.  I am using servlets 
2.2 so no question of using request.setCharEncoding()

rq here being an object of com.jspsmart.upload.Request

Again have no choice to change it.

Yes did carried out a snoop between the client machine and Server.  No data is being 
lost there so the prolem is in the code.

Thanx



 

Best Regards,
Khurram Ilyas
 


Chat with friends online, try MSN Messenger: Click Here