无法在 iPhone 上使用阿拉伯语键盘搜索波斯语文本
我最近为 iphone 开发了一本书,并在这个应用程序中实现了搜索功能.但在真正的 iphone 上测试了该应用程序后,我想知道它无法找到所有搜索词.(在我的 Mac 上使用波斯语键盘)
I have recently developed a book for iphone and implemented search function in this app. but after testing the app on a real iphone I wondered it cant find all of the search Terms. (using farsi keyboard on my mac)
例如它无法找到包含ی"字符的单词,因为搜索词包含从 iphone 阿拉伯语键盘插入的ي"字符!!
for example it cant find words containing "ی" character because the search terms contains "ي" character which is inserted from iphone arabic keyboard!!
我的文字很多,我找不到所有这些相似的字符!!
my texts are a lot and I cant find all of theses similar characters!!
有什么方法可以将我的波斯语文本转换为阿拉伯语文本吗?
Is there any way to convert my farsi text to arabic text?
我用这个方法解决了这个问题:
I fix the issue with this method:
- (NSString *)correctSearchTermCharcters:(NSString *)searchTerm
{
return [searchTerm stringByReplacingOccurrencesOfString:@"ي" withString:@"ی"];
}
如果需要,可以替换更多字符.
if you need you can replace more characters.