Solution to ODBC Chinese garbled characters in Linux

Source: Internet
Author: User
Recently, I was working on a Linux system. Based on portability considerations (MySQL, 0 racle, and DB may be used in the system database), I used ODBC to connect to the database.

Recently, I was working on a Linux system. Based on portability considerations (MySQL, 0 racle, and DB may be used in the system database), I used ODBC to connect to the database.

Recently, I was working on a Linux system. Based on portability considerations (MySQL, 0 racle, and DB may be used in the system database), I used ODBC to connect to the database.

Test Database: MySQL

Garbled characters occur when data is retrieved using ODBC.

Through online search solutions, the solution on the internet is based on the Linux graphical interface, and my Linux system does not have a graphical interface, and the method on the Internet cannot be solved.

After thinking, the problem may be caused by the different character sets used by the ODBC data source and those used by the database.

Through the experiment, it is true that the character set of the ODBC data source is different from the character set of the database.

The solution is as follows:

Add the following statement to the data source configuration file odbc. ini:

CHARSET = UTF8

UTF8 is the same as the character set of the database. The detailed configuration is shown in the following figure:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.