Bug #772 Wrong characters when retrieving strings from VB
Submitted: 1 Jul 2003 4:46 Modified: 20 Jan 2011 7:09
Reporter: Santiago Bayeta Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.12-nt OS:Windows (Windows 2000 Prof)
Assigned to: CPU Architecture:Any

[1 Jul 2003 4:46] Santiago Bayeta
Description:
When I retrieve strings from VB (using ADO and MySQL ODBC 3.51 Driver DSN), characters > 127 are displayed incorrectly (spanish app).
I'm not shure if it's bug, but the guys at vbmysql.com told me to report it (http://www.vbmysql.com/forums/viewtopic.php?t=71)
Thanks anyway

How to repeat:
MySQL:
USE test;
CREATE TABLE spanishcontents (spanishstring VARCHAR(16));
INSERT INTO spanishcontents VALUES('Termómetro');  /* ascii(ó) = 162 */

VB:
Dim con as ADODB.Connection
Dim rec as ADODB.Recordset
Dim sql as String

Set con = New ADODB.Connection
con.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _
                                    & "SERVER=192.168.10.43;" _
                                    & " DATABASE=test;" _
                                    & "UID=me;PWD=test; OPTION=3"
con.Open
sql = "SELECT * FROM spanishcontents;"
Set rec = con.execute(sql)
MsgBox rec.Fields(0).Value    'This shows "Term¢metro" instead of "Termómetro"

Note that I also tryed replacing the query in the VB code to
sql = "SELECT 'Termómetro';"

and the result was correct (The message box showed "Termómetro")
[3 Jul 2003 17:11] Michael Widenius
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem is not the result of a bug.
For a list of more appropriate places to ask for help using MySQL
products, please visit http://www.mysql.com/support/

Thank you for your interest in MySQL.

What probably happens here is that the mysql command client and your VB GUI program uses different characters sets.

MySQL 4.0 doesn't do any character transforms like the one indicated in the bug report, so this is probably not a MySQL problem.

Except for escaped characters \ and things related to quoting MySQL will return in the SELECT exactly the same binary string the you inserted.

If this is not the case, please provide information that shows that MySQL does a character transformation.
[8 Feb 2005 19:45] Sergei Golubchik
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.