Feedback
Did this article resolve your question/issue?

   

Article

Characters are returned incorrectly with MySQL ODBC driver when using the example application

Information

 
TitleCharacters are returned incorrectly with MySQL ODBC driver when using the example application
URL NameCharacters-are-returned-incorrectly-with-MySQL-ODBC-driver-when-using-the-example-application
Article Number000177242
EnvironmentProduct: Connect for ODBC MySQL driver
Version: 7.1
OS: all UNIX/Linux platforms
Database: MySQL
Application: example
Question/Problem Description
Characters are returned incorrectly when using the example application and connecting to a UTF8 database.
Steps to Reproduce
Clarifying Information
1. Create the following table:

CREATE TABLE t48714 (col VARCHAR(10) NOT NULL COLLATE 'utf8_spanish_ci') COLLATE='utf8_spanish_ci' ENGINE=InnoDB; 
INSERT INTO t48714 (c1) VALUES ('n'); 
INSERT INTO t48714 (c1) VALUES ('ñ'); 
INSERT INTO t48714 (c1) VALUES ('aaa'); 
INSERT INTO t48714 (c1) VALUES ('ááá'); 
INSERT INTO t48714 (c1) VALUES ('AAA'); 
INSERT INTO t48714 (c1) VALUES ('ÁÁÁ');


2. Run the following select sattement:

SQL> select * from t48714;

c1 

ñ 
aaa 
ááá 
AAA 
ÃÃÃ
Error Message
Defect Number
Enhancement Number
Cause
To see Unicode data correctly, a Unicode application is needed. The example application is not a Unicode application.
Resolution
Use a Unicode application.
Workaround
The data are returned correctly when specifying "SET NAMES utf8" first:

SQL> SET NAMES utf8

SQL> select * from t48714;

c1
n
ñ
aaa
ááá
AAA
ÁÁÁ
Notes
Last Modified Date8/18/2016 12:53 PM
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.