tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bilge Erkan <bi...@polar.biz.tr>
Subject International character problem in submitting a jsp form
Date Wed, 25 Feb 2004 10:53:30 GMT
Hi,

I'm using Tomcat 4.1.12. I have a trouble using Turkish characters in
inputs on my forms. I don't have any problem displaying constant strings
from resource files or displaying data retrieved from database where 
they both contain Turkish characters.

So I decided to make a simple test as follows:

I have a form with a text input in a jsp page. I post this form to
another jsp page and this page just prints this parameter value to
'out'. As a result Turkish characters are not displayed correctly.

The following is the jsp that has the form:

<%@ page language="java" contentType="text/html;charset=utf-8"
session="true"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
</head>
<body>
<form method="POST" name="Test" action="PostTest2.jsp">
     <input type="text" name="data">
     <input type="submit" name="buttonSubmit" value="OK">
</form>

</body>
</html>


The following is the jsp that the form is posted:

<%@ page language="java" contentType="text/html;charset=utf-8"
session="true"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
</head>
<body>
<%
     out.println(response.getCharacterEncoding());
     out.println(response.getLocale());
     out.println(request.getCharacterEncoding());
     out.println(request.getLocale());

     String s = request.getParameter("data");
     out.println(s);
     System.out.println(s);
%>

</body>
</html>


The output is as follows:

utf-8 en_US null tr Ä?üÅ?ıöçÄ?Ã?Å?Ä°Ã?Ã?

Here, the character encoding of the response seems to be utf-8, the
locale of the response seems to be en_US, the character encoding of the
request seems to be null (maybe the problem is here, but I don't know
how to solve) and the locale of the request seems to be tr.

I also tried to set charset to iso-8859-9 which is for Turkish
characters, instead of utf-8, but the problem is same. The output is as
follows:

iso-8859-9 en_US null tr ?ü??öç?Ü??ÖÇ


How can I solve this problem? Are there any settings to give to Tomcat?
How does Tomcat determine the locale of the server?

PS: I later tried to use Tomcat 4.1.30, and everything is same. 4.1.12
version that I'm using was an rpm installation and it has a tomcat.conf
file, in which there is a LANG parameter that I set it to tr_TR. But it
does not solve this problem. In 4.1.30 version there is no such a file
to set LANG. How can we make LANG setting in 4.1.30?


Thanks a lot,
Bilge


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message