The problem is well known in tomcat community.
There is no standard way to know the enconding of the
request.
For the response however there are quick solutions.
You could html escape the international characters you want to display.
(E.g. 水 (the chinese water character) or
Υ
Φ
the Greek characters Ypsilon and Phi).
This way it is irrelevant which charset you have set with contentType.
However if you dont want that html oriented solution, you should be careful
with encodings.

Alltho it is not a jboss issue at all i will explain to you my experience 
whith Greek.
I run jboss2.4.4 tomcat4.0.1.
I have started jboss with catalina with LANG=en_US (in linux)
and LC_ALL=en_US.

I set response.setContentType("text/html; charset=ISO-8859-7");
My jsp does not take into account my system's encoding for the encoding of 
the request, so it assumes ISO8859_1.
ISO8859_7 fits in 8 bits, so what catalina does is to read the 8 bit chars,
assume they are latin1 and construct a string with 0-left-padded Unicode 
chars.
Then i do grkBytes=myinputparam.getBytes() which takes into account systems 
encoding!
So i take my raw greek chars back.
I do then,
myGrkParam = new String(grkBytes,"ISO8859_7") and i have a valid Unicode
Greek String which i write to the DB.
Now, for the response.
As long as i have a valid Greek Unicode String, i can output that
correctly because JSP takes into account the charset in 
response.setContentType() (ISO-8859-7)
(Note the difference between encoding names in java and in http).
The moral of the story is that with JSP we can control the output encoding 
but not the input, because encoding cannot be set after the reader is got 
from the InputStream.
With servlets however, things are easier.
Your case is much harder cause chinese-japanese are not iso8859 compatible.
You should follow the tomcat lists for this kind of problems,
however i hope the above will be helpful.
-- 
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
tel:    +30-10-8981112
fax:    +30-10-8981877
email:  [EMAIL PROTECTED]
        [EMAIL PROTECTED]


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to