MySQLTalk.org Forum Index MySQLTalk.org
MYSQL discussions groups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Unicode (UTF-8) question

 
Post new topic   Reply to topic    MySQLTalk.org Forum Index -> MySQL ODBC
View previous topic :: View next topic  
Author Message
Daniel Levy
Guest





PostPosted: Sun Jan 29, 2006 11:00 am    Post subject: Unicode (UTF-8) question Reply with quote



Hi,

I need a database for keeping UTF-8 encoded text. I can see the data in the correct format (Chinese, Spanish, etc.) using the Query Browser, but when I run a query from my application, the text displays differently (I think its ANSI).

I have tried setting the character set of the table to utf8, and the specific column character set to utf8. I've also tried configuring the ODBC's Connect Options to 'set names utf8'; I've also checked options 'Don't Optiimze Column Width', 'Return Matching Rows', and 'Read Options From my .cnf'.

I'm using mysql-5.0.18 and mysql-connector-odbc-3.51.12. I'm developing with Delphi 5, using TNTware controls (Unicode).

Can somebody please give me any clues? Any advice will be greatly appreciated.

Thanks in advance,
Daniel Levy
Back to top
Paun
Guest





PostPosted: Mon Jan 30, 2006 11:00 pm    Post subject: RE: Unicode (UTF-8) question Reply with quote



Connector 3.51 have no support for Unicode. You must wait for 5.0 connector
(stil alpha ....)

I wait almost 1.5 year for this, but boys from MySQL AB have no reason to
rush in this field of development ...Now I work in MS Access again,
costumers dont want to wait anymore ...

-----Original Message-----
From: Daniel Levy [mailto:daniel (AT) mea (DOT) co.il]
Sent: Sunday, January 29, 2006 11:23 AM
To: myodbc (AT) lists (DOT) mysql.com
Subject: Unicode (UTF-Cool question


Hi,

I need a database for keeping UTF-8 encoded text. I can see the data in the
correct format (Chinese, Spanish, etc.) using the Query Browser, but when I
run a query from my application, the text displays differently (I think its
ANSI).

I have tried setting the character set of the table to utf8, and the
specific column character set to utf8. I've also tried configuring the
ODBC's Connect Options to 'set names utf8'; I've also checked options 'Don't
Optiimze Column Width', 'Return Matching Rows', and 'Read Options >From my
..cnf'.

I'm using mysql-5.0.18 and mysql-connector-odbc-3.51.12. I'm developing with
Delphi 5, using TNTware controls (Unicode).

Can somebody please give me any clues? Any advice will be greatly
appreciated.

Thanks in advance,
Daniel Levy

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.23/243 - Release Date: 27/01/06

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.23/243 - Release Date: 27/01/06
Back to top
Daniel Kasak
Guest





PostPosted: Mon Jan 30, 2006 11:00 pm    Post subject: Re: Unicode (UTF-8) question Reply with quote



Paun wrote:
Quote:
Connector 3.51 have no support for Unicode. You must wait for 5.0 connector
(stil alpha ....)

I wait almost 1.5 year for this, but boys from MySQL AB have no reason to
rush in this field of development ...Now I work in MS Access again,
costumers dont want to wait anymore ...

1.5 years?

Ha! A newcomer. Join the back of the queue please :)

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak (AT) nusconsulting (DOT) com.au
website: http://www.nusconsulting.com.au
Back to top
Daniel Levy
Guest





PostPosted: Tue Jan 31, 2006 1:00 pm    Post subject: Re: Unicode (UTF-8) question Reply with quote

Ok, thanks a lot Paun and Daniel. I think that answers my question...

Best regards,
Daniel Levy


----- Original Message -----
From: "Daniel Kasak" <dkasak (AT) nusconsulting (DOT) com.au>
To: "Paun" <spaun (AT) ptt (DOT) yu>; "Daniel Levy" <daniel (AT) mea (DOT) co.il>;
<myodbc (AT) lists (DOT) mysql.com>
Sent: Tuesday, January 31, 2006 12:55 AM
Subject: Re: Unicode (UTF-Cool question


Quote:
Paun wrote:
Connector 3.51 have no support for Unicode. You must wait for 5.0
connector
(stil alpha ....)

I wait almost 1.5 year for this, but boys from MySQL AB have no reason to
rush in this field of development ...Now I work in MS Access again,
costumers dont want to wait anymore ...

1.5 years?
Ha! A newcomer. Join the back of the queue please :)

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak (AT) nusconsulting (DOT) com.au
website: http://www.nusconsulting.com.au
Back to top
古雷
Guest





PostPosted: Sun Feb 05, 2006 1:00 am    Post subject: Re: Unicode (UTF-8) question Reply with quote

I use myODBC3.51. Chinese can be stored and fetched correctly with utf8 if I "SET NAMES utf8" after each connection established.

gu lei

----- Original Message -----
From: "Paun" <spaun (AT) ptt (DOT) yu>
To: "Daniel Levy" <daniel (AT) mea (DOT) co.il>
Cc: <myodbc (AT) lists (DOT) mysql.com>
Sent: Tuesday, January 31, 2006 6:39 AM
Subject: RE: Unicode (UTF-Cool question


Quote:
Connector 3.51 have no support for Unicode. You must wait for 5.0 connector
(stil alpha ....)

I wait almost 1.5 year for this, but boys from MySQL AB have no reason to
rush in this field of development ...Now I work in MS Access again,
costumers dont want to wait anymore ...

-----Original Message-----
From: Daniel Levy [mailto:daniel (AT) mea (DOT) co.il]
Sent: Sunday, January 29, 2006 11:23 AM
To: myodbc (AT) lists (DOT) mysql.com
Subject: Unicode (UTF-Cool question


Hi,

I need a database for keeping UTF-8 encoded text. I can see the data in the
correct format (Chinese, Spanish, etc.) using the Query Browser, but when I
run a query from my application, the text displays differently (I think its
ANSI).

I have tried setting the character set of the table to utf8, and the
specific column character set to utf8. I've also tried configuring the
ODBC's Connect Options to 'set names utf8'; I've also checked options 'Don't
Optiimze Column Width', 'Return Matching Rows', and 'Read Options >From my
cnf'.

I'm using mysql-5.0.18 and mysql-connector-odbc-3.51.12. I'm developing with
Delphi 5, using TNTware controls (Unicode).

Can somebody please give me any clues? Any advice will be greatly
appreciated.

Thanks in advance,
Daniel Levy

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.23/243 - Release Date: 27/01/06

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.23/243 - Release Date: 27/01/06


--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=leig (AT) sitechasia (DOT) com
Back to top
Daniel Levy
Guest





PostPosted: Sun Feb 05, 2006 4:00 pm    Post subject: Re: Unicode (UTF-8) question Reply with quote

Hi,

Thanks for your reply. I have tried this already but it didn't work for me.

Daniel Levy


----- Original Message -----
From: "古雷" <leig (AT) sitechasia (DOT) com>
To: "Paun" <spaun (AT) ptt (DOT) yu>; "Daniel Levy" <daniel (AT) mea (DOT) co.il>
Cc: <myodbc (AT) lists (DOT) mysql.com>
Sent: Sunday, February 05, 2006 2:56 AM
Subject: Re: Unicode (UTF-Cool question


Quote:
I use myODBC3.51. Chinese can be stored and fetched correctly with utf8 if
I "SET NAMES utf8" after each connection established.

gu lei

----- Original Message -----
From: "Paun" <spaun (AT) ptt (DOT) yu
To: "Daniel Levy" <daniel (AT) mea (DOT) co.il
Cc: <myodbc (AT) lists (DOT) mysql.com
Sent: Tuesday, January 31, 2006 6:39 AM
Subject: RE: Unicode (UTF-Cool question


Connector 3.51 have no support for Unicode. You must wait for 5.0
connector
(stil alpha ....)

I wait almost 1.5 year for this, but boys from MySQL AB have no reason to
rush in this field of development ...Now I work in MS Access again,
costumers dont want to wait anymore ...

-----Original Message-----
From: Daniel Levy [mailto:daniel (AT) mea (DOT) co.il]
Sent: Sunday, January 29, 2006 11:23 AM
To: myodbc (AT) lists (DOT) mysql.com
Subject: Unicode (UTF-Cool question


Hi,

I need a database for keeping UTF-8 encoded text. I can see the data in
the
correct format (Chinese, Spanish, etc.) using the Query Browser, but when
I
run a query from my application, the text displays differently (I think
its
ANSI).

I have tried setting the character set of the table to utf8, and the
specific column character set to utf8. I've also tried configuring the
ODBC's Connect Options to 'set names utf8'; I've also checked options
'Don't
Optiimze Column Width', 'Return Matching Rows', and 'Read Options >From
my
cnf'.

I'm using mysql-5.0.18 and mysql-connector-odbc-3.51.12. I'm developing
with
Delphi 5, using TNTware controls (Unicode).

Can somebody please give me any clues? Any advice will be greatly
appreciated.

Thanks in advance,
Daniel Levy

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.23/243 - Release Date: 27/01/06

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.23/243 - Release Date: 27/01/06


--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe:
http://lists.mysql.com/myodbc?unsub=leig (AT) sitechasia (DOT) com
Back to top
古雷
Guest





PostPosted: Mon Feb 06, 2006 2:00 am    Post subject: Re: Unicode (UTF-8) question Reply with quote

Quote:
I have tried setting the character set of the table to utf8, and the
specific column character set to utf8. I've also tried configuring the
ODBC's Connect Options to 'set names utf8';
How did you configure that option?

This is my may:
SQLHSTMT hstmtset;
SQLINTEGER rc;
rc = SQLAllocHandle (SQL_HANDLE_STMT, hdbc, &hstmtset);
if(rc<0)
{
ostringstream err;
err<<"SQLAllocHandle (SQL_HANDLE_STMT, hdbc, &hstmtset)"<<endl;
err<<getSQLError(SQL_HANDLE_STMT,hstmtset);
throwExecption(__FILE__,__LINE__,err.str());
}
char setnames[]="SET names utf8";
rc = SQLExecDirect(hstmtset,(SQLCHAR*)setnames,sizeof(setnames)-1);
if(rc<0)
{
ostringstream err;
err<<setnames<<endl;
err<<getSQLError(SQL_HANDLE_STMT,hstmtset);
throwExecption(__FILE__,__LINE__,err.str());
}
Our C/C++ application reads and writes utf8 Chinese with myODBC3.51. Our java application connect to MYSQL with JDBC. Both of them and MySQL Query Browser can get correct Chinese from MySQL.

Moreover, MySQL can convert character set between GB2312 and UTF-8. If my program SQLExecDirect "SET NAMES gb2312", it can read and write GB2312 Chinese from and to MySQL correctly even the columns' character set is utf8.

regards,
gu lei
Back to top
Daniel Levy
Guest





PostPosted: Thu Feb 09, 2006 4:15 pm    Post subject: Re: Unicode (UTF-8) question Reply with quote

I set it on the MyODBC connection properties, and also the database table. I
didn't do set it in the source code.

Regards,
Daniel


----- Original Message -----
From: "古雷" <leig (AT) sitechasia (DOT) com>
To: "Daniel Levy" <daniel (AT) mea (DOT) co.il>; "Paun" <spaun (AT) ptt (DOT) yu>
Cc: <myodbc (AT) lists (DOT) mysql.com>
Sent: Monday, February 06, 2006 3:09 AM
Subject: Re: Unicode (UTF-Cool question


Quote:
I have tried setting the character set of the table to utf8, and the
specific column character set to utf8. I've also tried configuring the
ODBC's Connect Options to 'set names utf8';
How did you configure that option?
This is my may:
SQLHSTMT hstmtset;
SQLINTEGER rc;
rc = SQLAllocHandle (SQL_HANDLE_STMT, hdbc, &hstmtset);
if(rc<0)
{
ostringstream err;
err<<"SQLAllocHandle (SQL_HANDLE_STMT, hdbc, &hstmtset)"<<endl;
err<<getSQLError(SQL_HANDLE_STMT,hstmtset);
throwExecption(__FILE__,__LINE__,err.str());
}
char setnames[]="SET names utf8";
rc = SQLExecDirect(hstmtset,(SQLCHAR*)setnames,sizeof(setnames)-1);
if(rc<0)
{
ostringstream err;
err<<setnames<<endl;
err<<getSQLError(SQL_HANDLE_STMT,hstmtset);
throwExecption(__FILE__,__LINE__,err.str());
}
Our C/C++ application reads and writes utf8 Chinese with myODBC3.51. Our
java application connect to MYSQL with JDBC. Both of them and MySQL Query
Browser can get correct Chinese from MySQL.

Moreover, MySQL can convert character set between GB2312 and UTF-8. If my
program SQLExecDirect "SET NAMES gb2312", it can read and write GB2312
Chinese from and to MySQL correctly even the columns' character set is
utf8.

regards,
gu lei
Back to top
natophonic
Junior Member


Joined: 23 Feb 2006
Posts: 2

PostPosted: Thu Feb 23, 2006 2:18 am    Post subject: Re: Unicode (UTF-8) question Reply with quote

古雷 wrote:

This is my may:
[...]
char setnames[]="SET names utf8";
rc = SQLExecDirect(hstmtset,(SQLCHAR*)setnames,sizeof(setnames)-1);
[...]
Our C/C++ application reads and writes utf8 Chinese with myODBC3.51. Our java application connect to MYSQL with JDBC. Both of them and MySQL Query Browser can get correct Chinese from MySQL.

Moreover, MySQL can convert character set between GB2312 and UTF-8. If my program SQLExecDirect "SET NAMES gb2312", it can read and write GB2312 Chinese from and to MySQL correctly even the columns' character set is utf8.

regards,
gu lei


Hi there, we're experiencing issues when moving from 3.51.07 to 3.51.10/12. I'm curious with which version(s) people are able to make this work?

Thanks!
-nate
Back to top
View user's profile Send private message
natophonic
Junior Member


Joined: 23 Feb 2006
Posts: 2

PostPosted: Fri Feb 24, 2006 2:05 am    Post subject: re:Unicode (UTF-8) question Reply with quote

Well, I was able to get it to work on Windows with 3.52.12 by setting the DNS's 'Connect Options'->'Initial Statement' to 'SET NAMES utf8'.

I was able to do the same successfully on Linux (3.25.10) and Solaris (3.52.12) by adding

STMT = SET NAMES utf8

to the DSNs in the odbc.ini file.

This was helpful, as I don't 'own' the code that would've needed to change to add a SQLExecDirect() statement! Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    MySQLTalk.org Forum Index -> MySQL ODBC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
Perl Forums  |  Education Forums  |  Learning Forums  |  File Systems Forums  |  Lustre / XFS Forums
SEO toolkit © 2004-2006 webmedic