tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bilge Erkan <bi...@polar.biz.tr>
Subject Re: International character problem in submitting a jsp form
Date Fri, 27 Feb 2004 21:08:16 GMT
Thanks for the answers. I found my solution. I found very good hints 
from the following link.

http://marc.theaimsgroup.com/?l=tomcat-user&m=105532850031181&w=2
that I have reached from
http://jakarta.apache.org/tomcat/faq/misc.html#utf8

The conversion explained in that link is really needed.

Now I have Turkish characters working with the following configuration. 
Hope it helps to others who have similar problems.

MySQL 4.0.16 (default_char_set=latin5)
MySQL jdbc driver 3.0.7-stable (Turkish characters have problems with 
previous versions, I have tried some 2.0 versions)
Java J2SDK 1.4.1
Tomcat 4.1.30 (Set charset ISO-8859-9 in JSP pages and convert posted 
strings to ISO-8859-9 as mentioned in the above link)

Bilge

---

Bilge Erkan wrote:
> 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
> 

-- 
-----------------------------------------------------------
  POLAR Mühendislik ve Danışmanlık Limited Şirketi
-----------------------------------------------------------
  POLAR Engineering and Consulting Limited
-----------------------------------------------------------
  bilge@polar.biz.tr
  Adr: Teknokent, SEM Ek Binasi, ODTU, 06531 Ankara, Turkey
  Tel: + 90 - 312 - 210 14 53
  Fax: + 90 - 312 - 210 17 99
  http://www.polar.biz.tr
-----------------------------------------------------------


---------------------------------------------------------------------
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