问题
for MySQL I'm using this and works very well with UTF-8.
SELECT * FROM cat.item_list WHERE CONVERT(item_name USING utf8) LIKE (:searchString)
I've tried same query with sqlite but it doesn't work. What should I do for UTF-8 SQLite3 search query? (with LIKE)
my current sqlite3 qry (which doesn't work with UTF-8 charsets):
SELECT * FROM item_list WHERE item_name LIKE '%$safeName%'
回答1:
Try this:
$query = "SELECT * FROM item_list WHERE item_name LIKE '%" . $safeName . "%'";
回答2:
I solved like that:
$tr_chars = array('ç','Ç','ı','İ','ğ','Ğ','ü','ö','Ş','ş','Ö','Ü');
$safeName = str_replace($tr_chars, '_', $safeName);
来源:https://stackoverflow.com/questions/41602892/sqlite3-like-query-with-utf-8-encoding