Garbled Chinese characters in the result set in the SQL window
Symptom
In Mac OS, when the character set of the OBServer node is GBK, garbled Chinese characters appear in the results returned for an SQL statement executed in the SQL window.
Possible causes
The character set the database expects the client to use is GBK. However, the client ODC uses UTF8, which is different from GBK. Client ODC allows you to encode data in SQL windows or command-line windows.
| Location | Linux | macOS | Windows |
|---|---|---|---|
| SQL window | UTF8 | UTF8 | UTF8 |
| Command-line Window | UTF8 | UTF8 | GBK |
You can run the following command to query the encoding format expected by the database:
show variables like '%character_set_c%';
The parameters are as follows:

Solutions
Modify the character set expected by the database so that it is compatible with the character set actually used by client ODC.
set names utf8mb4;
After the character set is modified, execute the SQL statement in the current session again and view the result set. The result set contains no Garbled Chinese characters.
Garbled Chinese characters in the result set in the command-line window
Symptom
In a Windows system, when the character set encoding of OBServer node is utf8mb4, Chinese character garbled characters appear in the returned results when SQL statements are executed in the command line window.
Possible causes
The character set the database expects the client to use is UTF8MB4. However, the client ODC uses GBK, which is different from UTF8MB4.
Solutions
Modify the character set expected by the database so that it is compatible with the character set actually used by client ODC.
set names gbk;
After the character set is modified, execute the SQL statement in the current session again and view the result set. The result set contains no Garbled Chinese characters.