Hi Tuan,
Did you set the page encoding to UTF-8? And one more thing, set the
characterEncoding of your request to UTF-8 before it hit your action
(ie, in a filter or something like that).
PS: I've found a bug in Tomcat with when encoding data to UTF-8 with the
GET method (the POST method is OK). Although you set the
characterEncoding of the request to UTF-8 in filter, but when it hit the
action of Struts, the character is still in ISO-8859-1 :-( . Here is the
quick fit for this:
byte[] temp = originalString.getBytes("ISO-8859-1");
String result = new String (temp, "UTF8");
Hope this may help.
PS: Do not flood the mailing list with duplicate message, you'll get
ignored quickly.
Pham Anh Tuan wrote:
> Hi all,
>
> I use Struts framework + Velocity, and I have a form with a text field,
> something like below:
>
> <form method="POST" action="$link.setAction("/saveIt")">
> <table>
> <tr>
> <td>
> <input type="text" name="something">
> </td>
> </tr>
> </table>
> </form>
>
> in velocity.properties file, I set:
>
> input.encoding=UTF-8
> output.encoding=UTF-8
> hiz, but with all above, I couldn't save unicode value of something property
> into my DB (Mysql 4.1, I had set all utf-8) :(
>
> but ... when I change the header of form tag like below, everything is fine,
> it's mean, I can save unicode value into DB :( ... I don't know why, help me
> plz :(
>
> <form enctype="multipart/form-data" method="POST"
> action="$link.setAction("/saveIt")">
>
> thanks in advance,
>
> bowlkhin
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]