开发者

How to make mysql return dataset in custom enconding?

The situa开发者_如何学Pythontion: there is a table with some default charset (e.g. ISO 8859-1). Question: is it possible to make SELECT which returns the data in some other encoding? E.g. utf8


You could use SET NAMES to specify the encoding of the requests. MySQL converts to that encoding all strings just before sending them to the client.

Note that on the MySQL part the character sets and collations stay the same, so take care when working with them, because they won't be UTF8 until they're returned to the client.


SELECT CONVERT(your_column_name AS utf8) FROM your_table

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜