Mega Code Archive

 
Categories / MySQL Tutorial / String Functions
 

To produce a string in a given character set, use the optional USING clause

mysql> mysql> SELECT CHARSET(CHAR(0x65)), CHARSET(CHAR(0x65 USING utf8)); +---------------------+--------------------------------+ | CHARSET(CHAR(0x65)) | CHARSET(CHAR(0x65 USING utf8)) | +---------------------+--------------------------------+ | binary              | utf8                           | +---------------------+--------------------------------+ 1 row in set (0.08 sec) mysql>