Segfault-Inc / Multicorn

Data Access Library
https://multicorn.org/
PostgreSQL License
700 stars 145 forks source link

UTF8 characters displayed as ???? #91

Open pishpecki opened 9 years ago

pishpecki commented 9 years ago

Hello,

The wraper is working great. There is one problem. When reading a remote mysql database that has utf8 characters all I get are question marks. Its clearly character set encoding problem. but where to set the encoding.

Thank you

rdunklau commented 9 years ago

Hello,

Le mardi 13 janvier 2015 00:57:06 Martin Pishpecki a écrit :

Hello,

The wraper is working great. There is one problem. When reading a remote mysql database that has utf8 characters all I get are question marks. Its clearly character set encoding problem. but where to set the encoding.

Which driver are you using ? What is the encoding of your local PostgreSQL database ? What is the encoding of your remote SQL database ? You should be able to control how to connect to MySQL by using the db_url parameter, and using the specific options to your driver. For a comprehensive list of supported options, please look at the specific documentation for your driver of choice on the SQLAlchemy documentation:

http://docs.sqlalchemy.org/en/rel_0_9/dialects/mysql.html

That's strange, Multicorn is not supposed to implicitly convert inconvertible charset by replacing them with the dreaded question mark character. Are you sure the data is correctly stored on the MySQL side ?

Ronan Dunklau

pishpecki commented 9 years ago

I found in SQLAlchemy documentation taht by adding at the end of your connection string "?charset=utf8" the problem goes away. For example: db_url 'mysql://mysql_user:PASSWORD@10.10.10.1/DatabaseName?charset=utf8'.