无法在iPhone上使用阿拉伯语键盘搜索波斯语文本 [英] can't search in farsi text with arabic keyboard on iphone

查看:130
本文介绍了无法在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.

这篇关于无法在iPhone上使用阿拉伯语键盘搜索波斯语文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆