我无法使用阿拉伯语文本进行变音符号不敏感搜索。
我已经为相关表测试了多种设置:utf8 和 utf16 中的编码以及 utf8_general_ci、utf16_general_ci 和 utf16_unicode_ci 中的排序规则。
搜索适用于 åä 特殊字符。IE:
select * from test where text like '%a%'
Run Code Online (Sandbox Code Playgroud)
将返回文本为 a、å 或 ä 的列。但它不适用于阿拉伯语变音符号。即如果文本是?????? 我搜索???,我没有得到任何点击。
任何想法如何通过这个?
真正的用途稍后将是 PHP(一个搜索功能),但我直接在 MySQL 数据库中工作,只是为了在将其移植到 PHP 之前进行测试。
(来自评论)
CREATE TABLE test (
? id int(11) unsigned NOT NULL AUTO_INCREMENT,
? text text COLLATE utf8_unicode_ci,
? PRIMARY KEY (id)?
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
Run Code Online (Sandbox Code Playgroud) How do I use @FetchRequest with a CoreData entity Post that has Codegen: Class Def. set in Xcode? So I don't create the Post" entity class manually, but let Xcode generate it?
I now get a
Use of undeclared type
Post
as an error on the last line.
@FetchRequest(entity: Post.entity(), sortDescriptors: [
NSSortDescriptor(keyPath: \Post.date, ascending: true)
])
var posts: FetchedResults<Post> // Use of undeclared type ´Post´
Run Code Online (Sandbox Code Playgroud)