Unicode (hexadecimal) character literals in MySQL

前端 未结 5 1640
遇见更好的自我
遇见更好的自我 2021-01-05 15:21

Is there a way to specify Unicode character literals in MySQL?

I want to replace a Unicode character with an Ascii character, something like the following:



        
5条回答
  •  长发绾君心
    2021-01-05 16:20

    Thanks for your suggestions, but I think the problem was further back in the system.

    There's a lot of levels to unpick, but as far as I can tell, (on this server at least) the command

    set names utf8
    

    makes the utf-8 handling work correctly, whereas

    set character set utf8
    

    doesn't.

    In my environment, these are being called from PHP using PDO, for what difference that may make.

    Thanks anyway!

提交回复
热议问题