如何在 SQLite 中实现重音/变音符号不敏感搜索?

发布于 2024-11-02 06:13:30 字数 242 浏览 0 评论 0原文

此问题与此处提出的问题,但我无法找出答案。

我已经在 SQLite 中启用了 ICU 支持并重建了数据库引擎,现在该怎么办?我通过执行 SELECT UPPER("ä") 检查了 ICU 支持,结果是 ä。

This question is related to the one asked here, but I couldn't figure out the answer.

I have enabled the ICU support in SQLite and rebuild the Db Engine, now what? I have checked the ICU support by executing SELECT UPPER("ä") which results in Ä.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

┾廆蒐ゝ 2024-11-09 06:13:30

根据 http://www.sqlite.org/faq.html#q18

(18) Unicode 字符的不区分大小写匹配不起作用。

The default configuration of SQLite only supports case-insensitive comparisons of ASCII
characters. The reason for this is that doing full Unicode case-insensitive comparisons
and case conversions requires tables and logic that would nearly double the size of the
SQLite library. The SQLite developers reason that any application that needs full Unicode
case support probably already has the necessary tables and functions and so SQLite should
not take up space to duplicate this ability.

Instead of providing full Unicode case support by default, SQLite provides the ability to
link against external Unicode comparison and conversion routines. The application can
overload the built-in NOCASE collating sequence (using sqlite3_create_collation()) and
the built-in like(), upper(), and lower() functions (using sqlite3_create_function()).
The SQLite source code includes an "ICU" extension that does these overloads. Or,
developers can write their own overloads based on their own Unicode-aware comparison
routines already contained within their project.

According to http://www.sqlite.org/faq.html#q18

(18) Case-insensitive matching of Unicode characters does not work.

The default configuration of SQLite only supports case-insensitive comparisons of ASCII
characters. The reason for this is that doing full Unicode case-insensitive comparisons
and case conversions requires tables and logic that would nearly double the size of the
SQLite library. The SQLite developers reason that any application that needs full Unicode
case support probably already has the necessary tables and functions and so SQLite should
not take up space to duplicate this ability.

Instead of providing full Unicode case support by default, SQLite provides the ability to
link against external Unicode comparison and conversion routines. The application can
overload the built-in NOCASE collating sequence (using sqlite3_create_collation()) and
the built-in like(), upper(), and lower() functions (using sqlite3_create_function()).
The SQLite source code includes an "ICU" extension that does these overloads. Or,
developers can write their own overloads based on their own Unicode-aware comparison
routines already contained within their project.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文