Unicode (hexadecimal) character literals in MySQL

前端 未结 5 1660
遇见更好的自我
遇见更好的自我 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:24

    The MySQL string syntax is specified here, as you can see, there is no provision for numeric escape sequences.

    However, as you are embedding the SQL in PHP, you can compute the right bytes in PHP. Make sure the bytes you put into the SQL actually match your client character set.

提交回复
热议问题