SQLite User Forum

case insensitive like and accented letters
Login

case insensitive like and accented letters

(1) By Luca Ferrari (fluca1978) on 2024-11-14 09:45:16 [link] [source]

Hi all,
I must be doing something wrong, but it seems to me that case
insensitive like is not working when there are accented letters:


% sqlite3 test.db
SQLite version 3.45.1 2024-01-30 16:01:20
Enter ".help" for usage hints.
sqlite> create table test( i varchar(10), c varchar(10) );
sqlite> insert into test( i, c ) values( 'perciò', 'PERCIÒ' );
sqlite> select * from test where i like '%perciò%';
perciò|PERCIÒ

-- not working
sqlite> select * from test where c like '%perciò%';

sqlite> PRAGMA case_sensitive_like=OFF;
-- not working
sqlite> select * from test where c like '%perciò%';
-- not working
sqlite> select * from test where i like '%PERCIÒ%';
-- working but without accented letters
sqlite> select * from test where i like '%PERC%';
perciò|PERCIÒ


Am I missing somethine here?

Thanks,
Luca

(2) By Stephan Beal (stephan) on 2024-11-14 09:53:22 in reply to 1 [source]

Am I missing somethine here?

See section 5 of www:/lang_expr.html.

(4) By Nuno Cruces (ncruces) on 2024-11-14 17:26:00 in reply to 2 [link] [source]

Also, if you need this, see www:/src/dir/ext/icu: "1.2 Unicode Aware LIKE Operator"

(3) By jose isaias cabrera (jicman) on 2024-11-14 14:33:37 in reply to 1 [link] [source]

You may also want to take a look at this post which has a lot of good info for this situation. IHTH.