-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Inserting emojis becomes ������ in JSON columns.
CREATE TABLE `test` (
`a` JSON COLLATE utf8mb4_unicode_ci,
`b` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
);DB::table('test')->insert([
'a' => json_encode(['text' => 'Hello world! æøå 😀']),
'b' => 'Hello world! æøå 😀',
]);Using the JSON_UNESCAPED_UNICODE flag seems to work:
This affects Eloquent models with JSON casting attributes (like array and object).
Is this related to Laravel, PDO MySQL driver, or SingleStore DB?
Normally, I would expect the stored JSON value to use backslashes to escape Unicode characters (PHP default with json_encode), but that does not seem to be the way SingleStore DB handles it.
Metadata
Metadata
Assignees
Labels
No labels

