I want to insert a record into MySQL that has a non-ASCII Unicode character, but I’m on a terminal that doesn’t let me easily type non-ASCII characters. How do I escape a Unicode literal in MySQL’s SQL syntax?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
See: http://bugs.mysql.com/bug.php?id=10199
(Bug #10199: “Allow Unicode escape sequence for string literals.”)
This request has been “Open” since 2005. More details in Worklog Task #3529: Unicode Escape Sequences.
From https://web.archive.org/web/20091117221116/http://eng.kaching.com/2009/10/mysql-unicode-escape-sequences.html
though, you can see the following example, which does actually seem to work, but requires you to know the actual byte-by-byte UTF8 encoding: