[odb-users] Garbled error when dealing with chinese character

Boris Kolpackov boris at codesynthesis.com
Wed Oct 21 10:01:20 EDT 2015

Hi Silvia,

沈英 <shenshuqing at 126.com> writes:

> when the MySQL database table is acessed by ODB, if there are some
> chinese characters in the table object, garbled error will occurs,
> such as "???".

You would need to provide a lot more detailed information than "garbled
error will occurs" to know for sure what's going on. Having said that,
I am pretty sure it has to do with the character encoding that the MySQL
client side is using. Take a look at the 'charset' argument in Section
17.2, "MySQL Database Class". Here is the relevant paragraph:

"The charset argument allows us to specify the client character set, that is,
the character set in which the application will encode its text data. Note
that this can be different from the MySQL server character set. If this
argument is not specified or is empty, then the default MySQL client character
set is used, normally latin1. Commonly used values for this argument are
latin1 (equivalent to Windows cp1252 and similar to ISO-8859-1) and utf8. For
other possible values as well as more information on character set support in
MySQL, refer to the MySQL documentation."


More information about the odb-users mailing list