I have a very basic webapp built with struts, basically it reads Chinese
characters and saves them in a database. The main servlet looks like this:
| request.setCharacterEncoding("UTF-8");
|
| String inputTex = form.getEnteredText();
|
|
|
The content header of input JSP was set to 'charset = "UTF-8". But the
characters saved in the DB was all question marks. After fiddling for days, I
added a statement like this:
inputTex = new String(inputTex.getBytes("ISO-8859-1"), "UTF-8");
and now everything works fine. It looks like JBoss would use ISO-8859-1 no
matter whatever is set in the request. Beside getting input value from a form
bean, I also tried getting it directly with
inputTex = request.getParameter("input");
and everything is same. The JBoss version I use is 4.0.1sp1. I saw similiar
problem reported by others using search, but no one gave a definitive answer.
Is this a bug?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3896198#3896198
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3896198
---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user