[Opensource] utf-8 problem
ershad
ershadr at yahoo.com
Mon Jan 19 05:02:46 PST 2004
Hello All
Thanks for your help Mike. I added useUnicode=true&characterEncoding=UTF-8
to the url.Now most of utf-8 farsi characters work properly but the are still problems with a few ones . Direct connection with JDBC using characterEncoding also yields the same
result even when i do not read the characters from the form and set it directly.It is better to test it in windows to.Anyway the problem is near to be solved and it is not the problem with expresso.
yours
Ershad Rahimikia
Mike Traum <mtraum at jgroup.net> wrote:I think it depends on your jdbc driver version, but adding:
useUnicode=true&characterEncoding=UTF-8
(jdbc:mysql://sprout:3306/sprout?user=ershad&password=123&useUnicode=true&characterEncoding=UTF-8)
to the jdbc connection string should take care of it.
There are several possibilities for failure here, so let us know if that
wasn't a cure-all...
hth,
mike
On Mon, 2004-01-12 at 09:09, ershad wrote:
> Hello All
>
> I have a curious problem when I try to work with utf-8 in my
> database.I have done the following:
> 1. setCharset("utf-8") is called in my DBObject.
> 2. content type is set in my JSPs with charset=utf-8
> 3. I am using mysql with utf8 support and com.mysql.jdbc.Driver JDBC
> (there is no problem with utf8 when I work directly with mysql command
> prompt).
> But both my own controllers and forms and DBMaint corrupt data during
> add and update.
> I am suspicious with JDBC because as I tried to update a row directly
> via PreparedStatment it did not worked as well. There was no errors as
> before but it corrupted my data.The code is shown below.
> Can anybody give me a hint for this problem.My project should be
> multilingual and this problem has made me really frustrated :(
>
>
> Class.forName("com.mysql.jdbc.Driver").newInstance();
> Connection connection =
> DriverManager.getConnection("jdbc:mysql://sprout:3306/sprout?user=ershad&password=123");
>
> String UPDATE=new String("UPDATE DEPARTMENT SET name = 'ewqeq' , phone
> = '432423' , assistantManager = null , departmentManager = null , fax
> = '' , note = ? , refCompany = 1 , addedBy = 3 , updatedBy = 3 ,
> AddedOn = '2003-11-11 17:47:26' , UpdatedOn = '2003-11-11 19:11:22'
> WHERE departmentSeq = 2");
>
> PreparedStatement ps=connection.prepareStatement(UPDATE);
> String name="";
> byte[] name_b=name.getBytes("UTF8");
> ps.setString(1,new String(name_b,"UTF8"));
> ps.executeUpdate();
>
>
>
> ______________________________________________________________________
> Do you Yahoo!?
> Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
--
Mike Traum
--
JGroup Expert
Expresso Core Developer
Providing support and development services - Available Now!
_______________________________________________
Opensource mailing list
Opensource at jcorporate.com
http://mail.jcorporate.com/mailman/listinfo/opensource
Archives: http://mail.jcorporate.com/pipermail/opensource/
---------------------------------
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.jcorporate.com/pipermail/opensource/attachments/20040119/5d4d0f09/attachment-0002.htm
More information about the Opensource
mailing list