Bug #32570 UTF-8 characters not displaying correctly using MyODBC 5.1.0
Submitted: 21 Nov 2007 12:48 Modified: 16 Jan 2008 17:44
Reporter: David Underwood Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:5.1.0 OS:Microsoft Windows (2003 SP2)
Assigned to: CPU Architecture:Any
Tags: ASP, myodbc 5.1.0, reading utf8 error, utf8

[21 Nov 2007 12:48] David Underwood
Description:
Hi. I have encountered a problem when reading UTF-8 characters using ASP and MyODBC 5.1.0. The data is being stored correctly in utf8 in the database, as viewing the tables using phpmyadmin displays them correctly (i'm referring to non english characters like ö or accented characters, japanese etc etc).

However, when I try and display these characters using ASP, they are displayed incorrectly. e,g, ö becomes ö. So they're losing their encoding in the connector (all pages are utf8, asp charset is utf8, i'm using SET Names in connection to set it to utf8).

Is this a known issue with 5.1.0, I can't find a similar bug report.

Thanks

How to repeat:
In a UTF8 encoded database, enter non-english characters into a VarChar field, then write a basic ASP page to write this data out to the browser. Use MyODBC 5.1.0 and MySql 5.0.45. UTF8 encoding will be lost.
[21 Nov 2007 16:26] Jim Winstead
You should not be using 'SET NAMES'. It is not at all necessary with the 5.1 driver.
[21 Nov 2007 17:05] Susanne Ebrecht
Hi David,

many thanks for writing a bug report.
Please, can you add a little test and the trace file.
[23 Nov 2007 13:15] David Underwood
I've taken out Set Names from the connection; I did think this wasn't doing much anyway, as everything's set to utf8 already. It hasn't solved the problem though.

I'm having trouble creating a trace file, as its the first time I've had to create one. I've followed these steps > http://dev.mysql.com/doc/refman/4.1/en/myodbc-configuration-trace.html but running it on odbc.dll doesn't do anything, no file is created at all. So I've tried changing the dll to myodbc5.dll, but it says its not traceable or is obsolete. Sorry to hassle you with this basic stuff, but any ideas?
[23 Nov 2007 13:34] Tonci Grgin
David, I will post a request to change that page. We removed tracing from driver because of:
 1) It slows things down
 2) Default tracing mechanism exists on all platforms

So, please open Control Panel/Administrative Tools/Data Sources (ODBC), go to tracing tab and click "Start tracing now".
[3 Dec 2007 19:18] Jess Balint
FYI, ODBC Driver Manager tracing does not work under IIS.
[3 Dec 2007 19:49] Tonci Grgin
Ah yes, as Jess said, http://support.microsoft.com/kb/836072.
[21 Dec 2007 3:28] Aeon Linn
I have the same problem with CJK utf8 uses.
myODBC 5.1.0 and MySQL 5.0.45,
save already correctly with IIS.ASP within ODBC 5.1.0 (SQL:update/insert)
display correctly in MySQL QueryBrowser 1.2.10...

but cannot select out with the same way.
the SQL select result is null.(SQL:select)
why??

is there any Idea ???
[21 Dec 2007 4:27] Aeon Linn
me again.

refer to Bug #28617,

instead of TEXT, use VARCHAR to make a temporary solution.

it's a bug

- utf8 TEXT cannot select out in v5.1.0 MyODBC
[21 Dec 2007 5:29] Aeon Linn
but the VARCHAR only supported to VARCHR(1365)

...
[24 Dec 2007 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[24 Dec 2007 19:23] Bogdan Degtyariov
This bug is duplicate of bug#28617. Patch for bug#28617 fixed the problem with TEXT columns.
[2 Jan 2008 5:20] Jess Balint
result after bug#28617 is fixed, confirmed working now

Attachment: bug32570_jess_myodbc_5.1.2.PNG (image/png, text), 32.74 KiB.

[2 Jan 2008 10:07] David Underwood
Excellent. Where can I download a new version of the driver from?
[2 Jan 2008 15:36] Jess Balint
David,
You can download a snapshot release of the driver at: http://downloads.mysql.com/snapshots.php
However there is no 32-bit Windows binary at the moment due to a problem with the build host. Please check back later for a Windows binary dated Jan 2, 2008 or later.
[16 Jan 2008 17:44] David Underwood
Jess,

Just a quick question about the Windows 32 snapshot zip file. Should I uninstall the current driver first? Also, the zip contains a myodbc-installer.exe file - can I just run that to do the install?

Sorry for the stupid questions, it was just slightly unclear from the install txt files in the zip.

Thanks for your help
[5 Mar 2008 9:01] Tonci Grgin
David, I would go for just replacing myodbc*.dll files.

Thanks for your interest in MySQL.