gpt4 book ai didi

MySQL unicode 文字

转载 作者:IT老高 更新时间:2023-10-29 00:08:15 25 4
gpt4 key购买 nike

我想在 MySQL 中插入一条具有非 ASCII Unicode 字符的记录,但我在一个不允许我轻松键入非 ASCII 字符的终端上。如何在 MySQL 的 SQL 语法中转义 Unicode 文字?

最佳答案

见:http://bugs.mysql.com/bug.php?id=10199(错误 #10199:“允许字符串文字的 Unicode 转义序列。”)此请求自 2005 年以来一直“开放”。更多详细信息请参见 Worklog Task #3529: Unicode Escape Sequences .

来自 https://web.archive.org/web/20091117221116/http://eng.kaching.com/2009/10/mysql-unicode-escape-sequences.html不过,您可以看到以下示例,它似乎确实有效,但需要您了解实际的逐字节 UTF8 编码:

You can also use the variable-length UTF-8 representation (convenient when, for example, copying from a utf-8 URL-encoded value like %E2%80%98).

mysql> select _utf8 x'E28098';  
+---+
| ‘ |
+---+

关于MySQL unicode 文字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3632410/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com