Japanese and chinese characters in ios

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 18:49:53

问题


I just had an error, at least different in Xcode. I tried to put support for another language in a few sentences of the app, when the user chooses to change the language the app accesses just another index of NSArray. What happens is that one of the languages ​​is Japanese, and ran a few sentences, others simply returned me the following:

 (
    "\U5f62\U5f0f",
    "\U9023\U63a5\U5230\U5176\U4ed6\U5730\U65b9",
    "\U884c\U674e\U8a8d\U9818",
    "\U9322"
)

The original NSArray was:

JapaneseTableTitles = [[NSArray alloc]initWithObjects:@"あなたが聞こえます",@"便利なフレーズ",@"語彙",@"対話",@"情報", nil];

回答1:


Are you NSLogging it? This is correct, as those are simply the Unicode code points of the Japanese/Chinese characters. If you do present those NSString in the UI (e.g. in a UILabel) they should appear correctly.

"\U5f62\U5f0f" = "形式"
"\U9023\U63a5\U5230\U5176\U4ed6\U5730\U65b9" = "連接到其他地方"
"\U884c\U674e\U8a8d\U9818" = "行李認領"
"\U9322" = "錢"


来源:https://stackoverflow.com/questions/11476014/japanese-and-chinese-characters-in-ios

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