I am trying to store json data into a column with JSON data type in MySql.
Here is the table:
CREATE DATABASE `testutf8` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
USE testutf8;
CREATE TABLE t2(jdoc JSON, sdoc TEXT);
INSERT INTO t2 VALUES('{"key1":"value1", "key2":"value2", "å": "value3"}','{"key1":"value1", "key2":"value2", "å": "value3"}');
SELECT * FROM t2;
However I get this result:
jdoc:
{"Ã¥": "value3", "key1": "value1", "key2": "value2"}
sdoc:
{"key1":"value1", "key2":"value2", "å": "value3"}
Apparently the column with JSON data type doesn't encode the characters correctly.
How can I fix this?
Thanks in advance :)