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

RE: UTF-8 issue with JSP for tomcat server

From: Thierry Sourbier <ml@i18nGurus.com>
Date: Mon, 16 Dec 2002 21:43:03 +0100
To: "Mushtaq \(by way of Martin Duerst <duerst@w3.org>\)" <mushtaq@ssoftnet.com>, <www-international@w3.org>

Dear Mushtaq,

There is likely a bug in your code. I'm attaching a sample JSP you can play
with to send/retreive Arabic text (I just retested Tomcat 4.0.6 with Arabic
data and it works without problems for me).


www.i18nGurus.com - The Open Internationalization Resources Directory.

=== Sample JSP starts here =======================
<%@ page

<body bgcolor="white">

Here you test how forms behave and/or misbehave:<br>
<b>Form get</b><form method=get>
<input name='form:get'size=50 type=text>
<input type=submit value=submit>

<b>Form post</b>
<form method=post>
<input name='form:post' size=50 type=text>
<input type=submit value=submit>
	Enumeration e = request.getParameterNames();
	if(e != null && e.hasMoreElements()) {
<b>Request parameters</b><br>
The parameters are read after calling request.setCharacterEncoding("UTF-8");
<TR valign=top>
	<TH align=left>Parameter:</TH>
	<TH align=left>Value:</TH>
		while(e.hasMoreElements()) {
			String k = (String) e.nextElement();
			String val = request.getParameter(k);
<TR valign=top>
	<TD><%= k %></TD>
	<TD><%= val %></TD>

=== End Sample JSP =======================
Received on Monday, 16 December 2002 15:44:32 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:40:47 UTC