这适用于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;
输出
+--------+---+
| hex(x) | x |
+--------+---+
| C3A9 | é |
+--------+---+
但是这使用的是默认字符集,而不是utf8
SELECT x'c3a9';
如何更改上述单行以输出UTF-8 é
而不是é
?