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: