Unicode not converted when displayed

半世苍凉 提交于 2019-12-04 03:15:30

问题


I'm localizing an app to spanish, and characters are encoded in the Localizable.strings file for that language using Unicode. For example, I have the entry:

"login.saveSettings"="Guardar configuraci\\u00F3n:";
which is displayed in a UILabel exactly like that ("Guardar configuraci\\u00F3n:"), instead of "Guardar configuración:". I tried different variations, such as "\u00F3", or "\\U00F3", but without any success.

I use NSLocalizedString this way:

self.saveSettingsLabel.text = NSLocalizedString(@"login.saveSettings", @"Save Settings:");

What am I doing wrong?

Thanks for any help! Mihai


回答1:


The correct variant is \U00F3 with 1 backslash and a capital U.




回答2:


I ended up finding a small Java program that replaces any Unicode sequence with the actual character: Conversion from javascript-escaped Unicode to Java Unicode



来源:https://stackoverflow.com/questions/3347688/unicode-not-converted-when-displayed

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