W3C home > Mailing lists > Public > www-international@w3.org > October to December 2001

How getParameter of Servlet works ?

From: souravm <souravm@infy.com>
Date: Fri, 5 Oct 2001 08:48:50 +0530
Message-ID: <755FA95DB839D211856B0008C7287D930DE6A860@kecmsg02.ad.infosys.com>
Cc: "W3intl (E-mail)" <www-international@w3.org>
Hi,

I have a form submitted to a Servlet. The form is submitted with charset
as UTF-8 (using the meta tag). The Servlet is running within iPlanet
Application Server in Solaris OS. The default charset encoding for the
OS is "C" (which I guess nothing but/equivalent to ISO-8859-1).

My qyery is when I make a getParameter call in the servlet how does it
work internally ? My understanding is browser will send stream of bytes
encoded in UTF-8 to the server. In that case will getParameter
internally create the String (which will be output for the getParametr
method) by converting those bytes (encoded in UTF-8) to string using
ISO-8859-1 as encoding type ?

My observation is when I change the locale of OS to have UTF-8 as
encoding type (say en_US.UTF-8) the String I get is different from the
previous case (i.e. with "C" as locale of OS).

Any explanation/clarification will be highly appreciated.

Regards,
Sourav
Received on Thursday, 4 October 2001 23:19:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 2 June 2009 19:16:57 GMT