Editor: MySQL adapter UTF8 issue on linux

Editor: MySQL adapter UTF8 issue on linux

choovickchoovick 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

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin

    Hi Alex,

    Thanks for the feedback. Sounds like a very good idea! I'll look at including this for the next release.

    Regards,
    Allan

This discussion has been closed.