Editor: MySQL adapter UTF8 issue on linux
Editor: MySQL adapter UTF8 issue on linux
choovick
Posts: 3Questions: 0Answers: 0
Everything was working on Windows XAMPP, but when I moved to the linux environment, all my server side responses were empty. json_encode was failing with: Malformed UTF-8 characters, possibly incorrectly encoded.
I'm using my sqldriver so I have addressed this issue by adding "charset=utf8" into connection URI within Driver/Mysql/Query.php:
$pdo = @new PDO(
"mysql:host={$host};{$port}dbname={$db};charset=utf8",
$user,
$pass,
array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
)
);
It might be wise to add similar option to other drivers as well.
Regards,
Alex
This discussion has been closed.
Replies
Hi Alex,
Thanks for the feedback. Sounds like a very good idea! I'll look at including this for the next release.
Regards,
Allan