- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这两个查询给出了完全相同的结果:
select * from topics where name='Harligt';
select * from topics where name='Härligt';
这怎么可能?看起来mysql在搜索时会将åäö翻译成aao。有什么办法可以关掉这个吗?
据我所知,我到处都使用 utf-8 编码。终端和 php 都会出现同样的问题。
最佳答案
是的,这是非特定于语言的 unicode 排序规则中的标准行为。
9.1.13.1. Unicode Character Sets
To further illustrate, the following equalities hold in both utf8_general_ci and utf8_unicode_ci (for the effect this has in comparisons or when doing searches, see Section 9.1.7.7, “Examples of the Effect of Collation”):
Ä = AÖ = OÜ = U
另请参阅Examples of the effect of collation
你需要要么
使用不具有此“功能”的排序规则(即 utf8_bin
,但这会产生其他后果)
仅针对查询使用不同的排序规则。这应该有效:
select * from topics where name='Harligt' COLLATE utf8_bin;
如果您想要进行不区分大小写的 LIKE
但不进行 Ä = A
变音转换,则会变得更加困难。我知道没有任何 mySQL 排序规则是不区分大小写的,并且不会执行这种隐式变音转换。如果有人知道,我很想听听。
相关:
关于MySQL 将 ÅäÖ 视为 AAO?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37189391/
这两个查询给出了完全相同的结果: select * from topics where name='Harligt'; select * from topics where name='Härligt
这两个查询给了我完全相同的结果: select * from topics where name='Harligt'; select * from topics where name='Härligt
我想在 Java 中输入可能包含字母 åäö 的字符串,但 Scanner 将它们转换为其他一些字符。我也尝试过使用 utf-8: String s1 = new Scanner(System.in)
我有一个 if 语句来检查是否有人输入了正确的输入,而不仅仅是空格或空白。我还希望它允许瑞典字母 å、ä 和 ö 而不仅仅是字母 a - z。我找不到正确的方法。感谢您的帮助! String name
我对在尝试让 UTF-8 和瑞典语字符 ÅÄÖ 在 UNIX-talk 克隆中正确打印时遇到的问题感到困惑。 我已经使用 setLocale() 将语言环境设置为 sv_SE,并且我正在使用宽字符来尝
这个问题在这里已经有了答案: Character reading from file in Python (9 个回答) 去年关闭。 所以代码我将一个 HTML 文件复制到一个字符串中,然后将除普通文
我有一个 Antlr4 语法,在尝试解析表达式时以无限循环结束。 运行 Antlr 4.7 版Java 1.8 表达式看起来像这样: monkey=Å 但如果正确的变量是一个字符串,它会起作用: mo
尝试在 iOS/objective C 中对具有特殊字符的字符串进行 URL 解码 字符串是“f%F6rv%E5nad” 试了用的方法 CFURLCreateStringByReplacingPerc
当用户在 EditTextbox 中输入值“Nedskräpning”时,它会在数据库中保存为“Nedskräpning”。所以我假设这个错误是从应用程序的 Android 部分生成的。更新: jav
就 SEO 而言:编码 ÅÄÖ 等字符的最佳方式是什么? 我在标题等中使用了 ö、å 但在谷歌网站管理员工具中,它们最终是这样的: "Sök bland inkomna förfr
我的服务器上有一些图片,以特殊字符 (å,ä,ö) 命名。我不知道如何转换 NSUrl 来获取它们: NSString *urlString = [NSString stringWithFor
这个查询: SELECT customer_id, customer_name FROM customers WHERE isActive = '1' ORDER BY customer_name A
这个问题在这里已经有了答案: How to encode the filename parameter of Content-Disposition header in HTTP? (21 个答案)
这个问题已经有答案了: UTF-8 all the way through (13 个回答) 已关闭 2 年前。 index.php 标题.php Lägg Till"; ?> 结果 L?gg Ti
我使用 awk (mac os x) 只打印 n 个字符及更长的行。 如果我在如下所示的文本文件(strings.txt)上尝试: four foo bar föö bår fo ba fö bå 我
这个问题已经有答案了: UTF-8 all the way through (13 个回答) 已关闭 2 年前。 index.php 标题.php Lägg Till"; ?> 结果 L?gg Ti
我正在尝试发送包含 ÅÄÖ 字符(瑞典语)的邮件。 我试过将邮件 header 更改为 UTF-8 和 iso-8859-1,但都不起作用。我也试过将文本包装在 utf8_encode() 和 mb_
我正在用值填充文本框,但出于某种原因,当我使用 QueryString 时,“ÅÄÖ”字母会转换为奇怪的字符。它仅在我使用 QueryString 时发生,所以问题不在我的网络配置中。 它是这样的:
问题: 在 db 中插入 ¤à¶ 中输入 åäö。该文件采用 UTF-8 格式,无 BOM,表中的注释具有 utf8_general_ci 联盟。 代码:
如何保留 åäö 但从字符串中删除所有其他非字母数字字符?(我发现了类似的问题,但似乎都没有正确的答案。) 我尝试了一些东西,比如扩展正则表达式,试图让它跳过子句中的 åäö,但它似乎只是让正则表达式
我是一名优秀的程序员,十分优秀!