dev@javaserverfaces.java.net

Re: Unicode in JSF

From: Gabriel Klein <gabriel.klein_at_nuage.ch>
Date: Thu, 13 Oct 2011 13:05:57 +0200

1)
Your mysql tables must be using UTF-8

2)
Somewhere where you define the mysql url, you must have "UTF-8".

Here is an (unchecked) example.
...
       driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/
ID_development?useEncoding=true&amp;characterEncoding=UTF-8"
...


Hope it helps.

Gab

On Thu, 2011-10-13 at 07:36 +0700, Phạm Thanh Tùng wrote:
> Thank you, it's fine, but current i have other problem, when i
> insert from form to DB MySQL, i have same trouble - error font
> unicode. I use JSF and Store Procedure(SP) for query, so how i can
> handle font unicode that is parameter of SP.
> ____________________________________________________________________________________________________________
> My name is Phạm Thanh Tùng
>
>
>
> Vào 21:00 Ngày 12 tháng 10 năm 2011, Mehdi Sidhoum
> <mehdi.sidhoum_at_geomatys.fr> đã viết:
> Le 11/10/2011 19:23, Phạm Thanh Tùng a écrit :
>
> Dear JSF Experts,
> I don't know send mail to this email address is
> exactly but hope is true.
> Current i developing a website and have trouble,
> that is unicode. I
> search and tried few ways but fail. Eg: set meta tag
> (both cases html
> and xhtml), set acceptCharset="utf-8" in tag form,
> edit web.xml but
> seem nothing change.
> I hope soon received solution for this.
> Thank you,
>
> Hi Phạm Thanh Tùng,
>
> You can add a filter in your webapp to encode all strings in
> utf8, take a look here :
> http://www.jroller.com/mert/entry/utf_8_encoding_with_jsf
>
> Hope this will be usefull for you
>
> Best regards.
>