Hi, I know it is a nightmare.
We love Java, don't we? We love Tomcat, don't we? So what about internalization?
Thanks,
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
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]