How to display Text in Arabic in UIlabel

久未见 提交于 2019-12-21 21:39:23

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/4211160/how-to-display-text-in-arabic-in-uilabel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!