0

How can I set connection charset to utf8 in apache mod_dbd with mysql driver? I could not find any corresponding parameter in DBDParams, something like this:

DBDParams host=localhost,dbname=my_db,user=my_user,pass=my_pass,reconnect=0,charset=utf8

which of course there is no such charset parameter in reality.

Ehsan Khodarahmi
  • 285
  • 1
  • 7
  • 17

1 Answers1

0

utf-8 is not part of the connection, it's how the database is managing its charset. You need to convert your database over if you want things to be transmitted and handled in utf-8. Found this on StackOverflow:

https://stackoverflow.com/questions/6115612/how-to-convert-an-entire-mysql-database-characterset-and-collation-to-utf-8

which should lead you down the right path.

  • It IS part of connection according to this link: https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_character_set_connection My database charset is already unicode, but I don't know how to set connection charset – Ehsan Khodarahmi Dec 23 '17 at 05:24