Bry*_*eld 3 mysql string hex utf-8 character-encoding
这适用于 UTF8
create temporary table test (x char(1) not null) charset=utf8;
insert into test select x'c3a9';
select hex(x), x from test;
drop table test;
Run Code Online (Sandbox Code Playgroud)
产出
+--------+---+
| hex(x) | x |
+--------+---+
| C3A9 | é |
+--------+---+
Run Code Online (Sandbox Code Playgroud)
但这使用了不是 utf8 的默认字符集
SELECT x'c3a9';
Run Code Online (Sandbox Code Playgroud)
如何更改上述单行以输出 UTF-8é而不是é?