Case insensitive utf8 select

后端 未结 3 856
无人及你
无人及你 2021-01-13 15:15

In SQLite I want to case-insensitive \"SELECT LIKE name\" works fine for normal latin names, but when the name is in UTF-8 with non-latin characters then the se

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-13 15:45

    Use a no-case collation, such as : LIKE name COLLATE NOCASE

    If you need specific characters that are not part of ASCII to be compared with case folding, the NOCASE will not work, as such folding is not supported by SQLite - you will have to provide your own collation function using your Unicode library of choice and sqlite3_create_collation().

    EDIT: also, this might be interesting:

    How to sort text in sqlite3 with specified locale?

提交回复
热议问题