Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Localization: Unicode character escape sequences, which have the form '\uxxxx' does not work

We have key-value pair in Localization.string file.

"spanish-key" = "Espa\u00f1ol";

When we fetch and assign to label then app displays it as "Espau00f1ol".

Doesn't work.

self.label1.text= NSLocalizedString(@"spanish-key", nil);

It works- shows in required format.

self.label1.text= @"Espa\u00f1ol";

What could be the problem here when we use

NSLocalizedString(@"spanish-key", nil)?

If we set \U instead of \u, then it works.

 "spanish-key" = "Espa\U00f1ol";

When to use "\Uxxxx" and "\uxxxx"?

like image 758
Gaurav Borole Avatar asked May 04 '14 05:05

Gaurav Borole


1 Answers

Just write the string in proper Unicode in Localization.string.

"spanish-key" = "Español";
like image 177
gnasher729 Avatar answered Oct 13 '22 04:10

gnasher729