Set encoding for each mysql connection

It was the fix related to #727.

Did you see my other merge requests ?