【问题标题】:Mysql doesn't display right single quotation mark(’) after inserted into tableMysql插入表后不显示右单引号(')
【发布时间】:2012-09-12 11:49:33
【问题描述】:


我有一张名为“测试”的表。我在名称字段中插入了一行包含 unicode 字符右单引号 (') 0x2019
SQL:

 //insert into Testing values(Sno,Name,Address)    
   insert into Testing values(1,"**Rajesh’s Friend**","Cumbum");

Mysql Query BrowserCommandLine 中列出同一行时。它显示为普通的 ANSI 字符('),而不是 unicode 字符。

我想在 MySQL 表中显示相同的 unicode 字符。

【问题讨论】:

  • 表格设置为什么排序规则?你能提供 SHOW CREATE TABLE 测试的输出吗? ?
  • 我经常看到这种情况,因为它构成了 sql 注入的一部分,只要您对字符串进行转义,它就会起作用。
  • 怎么知道是不是ascii? ` SELECT HEX("'") 'utf8 quote', HEX("'") 'ascii quote'; +------------+-------------+ | utf8 报价 | ascii 报价 | +------------+-------------+ | E28099 | 27 | +------------+-------------+`

标签: mysql unicode character


【解决方案1】:

您可以尝试ALTER TABLE Testing COLLATE='utf8_unicode_ci';更改编码。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-10-02
    • 2015-08-07
    • 2018-08-18
    • 2018-07-16
    • 2017-05-06
    • 1970-01-01
    • 1970-01-01
    • 2013-11-14
    相关资源
    最近更新 更多