> Jun Wang wrote:
>
>
> Problem 1:
> I use a submit form to call the GuestBookServlet, the form has a text field "name", 
>the servlet can get the parameter value of "name" when it only contains 8-bit code, 
>but when it contains 16-bit
> code (Simple Chinese Code "GB2312"), getParameter("name") is ?? , ie, one 16-bit 
>code is placed with one ?? . I find the NC browser's Location toolbar show the 
>correct 16-bit code of the "firstname"
...
> I joined the servlet-users about 10 days ago, I have browsed the old mails, but 
>seldom found the i18n questions, except Shashank and Yoko have talked about it. Maybe 
>servlet i18n question is the old
> and resolved question, anyone give me the resolving pointers ? Thanks.
>
> Jack

We have discussed this topic on 1999-06-03:

>Bill Burton wrote:
>> How do I correctly handle the parsing of the query string and form input
>> such that req.getParameter will return the contents appropriately converted
>> from a native character encoding such as Shift_JIS to Unicode?
>>
>> Unless I'm missing something, it appears the 2.x Servlet API doesn't provide
>> a way to indicate what character encoding should be used when parsing the
>> query string and form input.
>
>javax.servlet.ServletRequest.getCharacterEncoding() gives you
>encoding of input data. But HTTP protocol has no standard way of
>specifying encoding of data sent from browser to server,
>so it will ALWAYS give ISO-8859-1. I think this is an error
>in design of HTTP protocol.
>
>So the only way how you can handle it is:
>
>new 
>String(request.getParameter("par").getBytes(request.getCharacterEncoding()),"JISAutoDetect");
>

Martin


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   INET, a.s.                          Mgr. Martin Kuba
Kralovopolska 139                  e-mail: [EMAIL PROTECTED]
  601 12 Brno                      WWW: http://www.inet.cz/~makub/
 Czech Republic                    tel: +420-5-41242414/33
--------------------------------------------------------------------
PGP fingerprint = D8 57 47 E5 36 D2 C1 A1  C3 48 B2 59 00 58 42 27
 http://wwwkeys.cz.pgp.net:11371/pks/lookup?op=index&search=makub
--------------------------------------------------------------------

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to