2011-05-02 118 views
2

這工作UTF8MySQL的輸出十六進制的字符串作爲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 é而不是é

回答

相關問題