RE: JSP international character support

You should probably check to be sure the application server is running in
(was started with) an ISO-8859-1 locale. Your code presumes that the app
server has done an ISO-8859-1 -> UCS-2 conversion, but the actual conversion
done is influenced by the application server’s locale (in some application
servers).

Steve


Steve Billings
Global 360
Software Globalization Consulting
URL: http://www.global360.com/
Email: billings@global360.com <mailto:billings@global360.com>
TEL: +1 978-697-8201

-----Original Message-----
From: www-international-request@w3.org
[mailto:www-international-request@w3.org]On Behalf Of Khurram Ilyas
Sent: Monday, July 22, 2002 8:17 PM
To: www-international@w3.org
Subject: JSP international character support


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
<http://g.msn.com/1HM1ENUS/c144??PS=47575>

Received on Monday, 22 July 2002 22:51:51 UTC