如何在UIlabel中显示阿拉伯语文本 [英] How to display Text in Arabic in UIlabel
问题描述
我从服务器获取此字符串作为回应,实际上是阿拉伯语نريد& ;#1571;ننرىهذافي& ;#1575;للغةالعرب& ;#1610;ة
你可以在浏览器上看到阿拉伯语中的这个文本:نريدأننرىهذافياللغ العربية浏览器自动显示阿拉伯语文本。对于前我已经把代码标签,所以它显示代码...
现在我想用阿拉伯字体在UILabel上显示它,我该怎么做?
请帮助..
谢谢
如果将服务器响应字符串中的每个4位文本数字十进制数转换为C int,则可以使用以下内容将每个字符转换为NSString:
int c = ... / *你的4个文本数字unicode ordinal转换为整数* /
charString = [NSString stringWithFormat:@%C, C ];
您可能还可以要求UIWebView运行一行Javascript并返回NSString。 / p>
I am getting this string from server in response, which is actually in arabic
"نريد أن نرى هذا في اللغة العربية
"
You can see this text in arabic on browser like this : نريد أن نرى هذا في اللغة العربية browser automatically shows text in arabic. for former i have put code tag so it is showing codes...
Now I want to show it on UILabel in arabic fonts, how would I do that?
Please help..
Thanks
If you convert each 4 text digit decimal number in the server response string to a C int, then you can convert each character to an NSString using something like:
int c = ... /* your 4 text digit unicode ordinal converted to an integer */
charString = [ NSString stringWithFormat:@"%C", c ];
You might also be able to ask a UIWebView to run a line of Javascript and return an NSString.
这篇关于如何在UIlabel中显示阿拉伯语文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!