8

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

Mihai Fonoage
  • 478
  • 2
  • 8
  • 23

1 Answers1

26

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

kennytm
  • 510,854
  • 105
  • 1,084
  • 1,005
  • Absolutely right. From all combinations I tried, I missed the right one. Thank you! – Mihai Fonoage Jul 31 '10 at 15:47
  • but if i am sending this one in JSON then its raising error invalid JSON escape sequence. but works fine if there is \u. but iOS is converting it only in \U – Mrug Apr 26 '14 at 14:59
  • @Mrug: JSON and plist are two entirely different format! – kennytm Apr 27 '14 at 07:21
  • Yes KennyTM i know. But the issue is not of plist. I am sending Unicodes to Webservice of JAVA but it is firing error just because of Capital U in unicode. JAVA guy is asking me to send it in small casing . Then What to do ? – Mrug Apr 28 '14 at 04:22