MySQL Forums
Forum List  »  Chinese

中文乱码问题
Posted by: James Mao
Date: September 17, 2007 04:36AM

Hi,

I'm using jdk6, ibatis2.1.7, and mysql-conn 5.0.5, with mysql 5.0.45

但插入中文是乱码

用下面语句创建数据库:
> create database mydb default charset utf8 COLLATE utf8_general_ci;

用下面url连接数据库

> jdbc:mysql://localhost/mydb?useUnicode=true&characterEncoding=UTF8

紧接插入数据库,中文都是??

但我改用 mysql-conn 3.0.10,
创建数据库,用默认编码,
使用下面的url
> jdbc:mysql://localhost/mydb?useUnicode=true&characterEncoding=gbk (or gb2312)

插入就没问题

Sounds like the utf-8 is not working in the version above 3.0.10, i tried, 3.1.14 and 5.0.5, 5.0.7, they both failed.

Am i miss something? or is it a know issue.

Thanks very much
James

Options: ReplyQuote


Subject
Views
Written By
Posted
中文乱码问题
27927
September 17, 2007 04:36AM
9615
October 15, 2007 08:56PM
8615
December 05, 2007 11:56PM
8128
January 12, 2009 02:41AM
8996
April 07, 2009 01:31AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.