persian/arabic search in sqlite android gives bad

2019-03-18 04:31发布

i have a problem with sqlite database. it seems to not support full persian/arabic characters. when i search some fields based on persian chars, most of the times Sqlite can't recognize those chars.

i insert data into database by copy them from HTML file. so when i type string and search, no result show. but if i copy string and search, it works.

The string from the HTML file is:

"احكام خمس"

The typed string is:

"احکام خمس"

3条回答
够拽才男人
2楼-- · 2019-03-18 04:54

These strings are different.

The HTML string begins with the characters U+0627, U+062D, and U+0643 (Alef, Hah, and Kaf).

The third character of the typed string is not U+0643 but U+06A9 (Keheh).

查看更多
放荡不羁爱自由
3楼-- · 2019-03-18 04:56

Try this:

select part from table where season = N'خمس';

If that not help, try using operators like and %.

I'm already using SQLite for more than 2 years in Persian supported projects in production environments and has no problem at all.

Udate:

I'm using SQLite via NHibernate. So myself never generate or write a query. To be honest never noticed how NHibernate send queries to SQLite.

查看更多
4楼-- · 2019-03-18 05:04

Sqlite is very simple supported persian/arabic.
read this link. sqlite database in persian language

查看更多
登录 后发表回答