M
Martin Fuchs
Hi,
I want to handle multilingual user entrys (english, cyrillic, german)
from a HTML-Form in a Servlet. The Servlet-Container is Tomcat5 with
Axis.
The HTML looks something like this:
----------------------------------------------------------
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
....
<body>
<form method="post" action="/axis/servlet/ObjectSearchServlet"
target="OBJ_SEARCH_RESULT" accept-charset="UTF-8">
....
<input name="test"...>
....
<form>
</body>
</html>
----------------------------------------------------------
At the beginning of the "doPost"-method in the Servlet I set the
character encoding of the request to utf-8:
----------------------------------------------------------
request.setCharacterEncoding("UTF-8");
----------------------------------------------------------
Later I fetch the parameter from the request and write the string to
System.out
----------------------------------------------------------
string = request.getParameter("test");
System.out.println(string);
----------------------------------------------------------
Everything works fine with german or english letters, but the cyrillic
letters are "trash".
I spent several hours on reading web-sites an postings and tried a lot
of different ways, but it didn't work.
Does anyone no what the problem could be?
Best regards,
Martin
I want to handle multilingual user entrys (english, cyrillic, german)
from a HTML-Form in a Servlet. The Servlet-Container is Tomcat5 with
Axis.
The HTML looks something like this:
----------------------------------------------------------
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
....
<body>
<form method="post" action="/axis/servlet/ObjectSearchServlet"
target="OBJ_SEARCH_RESULT" accept-charset="UTF-8">
....
<input name="test"...>
....
<form>
</body>
</html>
----------------------------------------------------------
At the beginning of the "doPost"-method in the Servlet I set the
character encoding of the request to utf-8:
----------------------------------------------------------
request.setCharacterEncoding("UTF-8");
----------------------------------------------------------
Later I fetch the parameter from the request and write the string to
System.out
----------------------------------------------------------
string = request.getParameter("test");
System.out.println(string);
----------------------------------------------------------
Everything works fine with german or english letters, but the cyrillic
letters are "trash".
I spent several hours on reading web-sites an postings and tried a lot
of different ways, but it didn't work.
Does anyone no what the problem could be?
Best regards,
Martin