Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Like does not work with Russian symbols? (ICU support) #1025

Open
Wolfaks opened this issue Oct 8, 2020 · 4 comments
Open

Like does not work with Russian symbols? (ICU support) #1025

Wolfaks opened this issue Oct 8, 2020 · 4 comments

Comments

@Wolfaks
Copy link

Wolfaks commented Oct 8, 2020

Hello. I use like with lowercaseString and Russian symbols but LOWER doesn't convert them to lowercase in the query. I tried to create my own function but it didn't work for me. How to solve this problem? Thanks.

// in name value: ПРИВЕТ from database
let search_name = "Привет"
user.filter(name.lowercaseString.like("%" + search_name.lowercased() + "%"))

@Wolfaks
Copy link
Author

Wolfaks commented Oct 8, 2020

Having studied the documentation of SQLite, I learned that you need to connect the ICU library. How can this be done in this plugin? Thanks.

@jberkel
Copy link
Collaborator

jberkel commented Aug 23, 2021

You need to use it with a version of SQLite compiled with SQLITE_ENABLE_ICU. As far as I can tell there's no out of the box way of doing this, and the sqlite3 pod doesn't seem to provide this.

There is an open ticket for it though, see clemensg/sqlite3pod#13

Another option would be to do the lower case transformation on the “Swift” side, and pass it through to the query (not always possible, but would work for the simple example you gave above).

@jberkel jberkel changed the title Like does not work with Russian symbols? Like does not work with Russian symbols? (ICU support) Aug 24, 2021
@jberkel jberkel removed the bug label Aug 25, 2021
@clemensg
Copy link

Hi, just wanted to let you know that I added a branch with experimental support for ICU. I could only test it on macOS 12.1 so far, so it would be great if you could try it out and report back.
You can reference the branch like this pod 'sqlite3', inhibit_warnings: true, subspecs: ['icu'], git: 'https://github.com/clemensg/sqlite3pod.git', branch: 'icu'

@jberkel
Copy link
Collaborator

jberkel commented Dec 22, 2021

@clemensg great, thanks for the notification, will try it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants