0

We require emoji support for a legacy Laravel 3 system using MySQL 5.5 - we believe have utf8mb4 support for the table since it stores an emoji character without an error after updating the table and we can see the value in MySQL Workbench.

We, receive a ? character instead of the emoji in the front end and http response from Laravel 3 so we suspect there is a lack of support there.

Is there a way to update Laravel 3 config to support this? We can't update to a higher version at this stage.

Ruegen
  • 605
  • 9
  • 35

1 Answers1

0

In the file config/database.php: 'mysql' => [..., 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', ...]

If you would like to log the MYSQL of the query you can use this: \DB::enableQueryLog(); before the query and this: logger(\DB::getQueryLog() ); afterwards. This will save the query to your laravel log file Navicat

Old versions of Navicat have an option for utf8, but not for utf8mb4. So, if you need utf8mb4,... In the encoding options for navicat connections, pick "use mysql encoding", not "utf8".

See also "question mark" in Trouble with UTF-8 characters; what I see is not what I stored

Rick James
  • 135,179
  • 13
  • 127
  • 222