LINQ to SQL & SQLite - Searching in UTF-8 string
Posted: Wed 20 Jan 2016 14:26
I am programming an "Articles Archieve" contains articles about law. For this, I am using Linq to SQL and SQLite. And authors' names contain UTF-8 characters. When I search "oğuz" term in the search textbox, it returns KARABULUT, Ayşe/EMİR, Oğuz - PİLOT, Oğuz/GÜNAŞTI, Emin - AYDOST, Oğuz Ali - İNAL, Oğuz Mehmet. But it does not find and does not return OĞUZ, Habip - OĞUZOĞLU, Ali - OĞUZ, Kemal - OĞUZMAN, Cemallettin.
In the same way, when I search "OĞUZ" term in the search textbox, it returns same datas as "oğuz" term. Here is my code:
In the same way, when I search "OĞUZ" term in the search textbox, it returns same datas as "oğuz" term. Here is my code:
And this is SQL "article" table information:readonly LtoSQliteDataContext _db = new LtoSQliteDataContext();
IQueryable<article> results = (from m in _db.articles
where m.author.ToLower().Contains(textBox1.Text.ToLower())
select m).Distinct();
CREATE TABLE [article] ([id] INTEGER PRIMARY KEY AUTOINCREMENT, [title] VARCHAR(300), [author] VARCHAR(100) COLLATE NOCASE, [info] VARCHAR(300), [file] VARCHAR(50), [lesson] VARCHAR(50), [created] DATETIME, [updated] DATETIME);