iOS Localization: Unicode character escape sequences, which have the form '\uxxxx' does not work
NSString
literals and strings-files use different escaping rules.
NSString
literals use the same escape sequences as "normal" C-strings, in particular
the "universal character names" defined in the C99 standard:
\unnnn - the character whose four-digit short identifier is nnnn
\Unnnnnnnn - the character whose eight-digit short identifier is nnnnnnnn
Example:
NSString *string = @"Espa\u00F1ol - \U0001F600"; // Español - br>
Strings-files, on the other hand, use \Unnnn
to denote a UTF-16 character,
and "UTF-16 surrogate pairs" for characters > U+FFFF:
"spanish-key" = "Espa\U00f1ol - \Ud83d\Ude00";
(This is the escaping used in "old style property lists", which you can see when printing
the description of an `NSDictionary.)
This (hopefully) answers your question
When to use "\Uxxxx" and "\uxxxx"?
But: As also noted by @gnasher729 in his answer, there is no need to use Unicode
escape sequences at all. You can simply insert the Unicode characters itself,
both in NSString
literals and in strings-files:
NSString *string = @"Español - ;
"spanish-key" = "Español - ;
Swift use unicode character in localization.strings
You have to follow localization.strings's unicode format, e.g.:
"your-key" = "\UF071";
Swift use unicode character in localization.strings
You have to follow localization.strings's unicode format, e.g.:
"your-key" = "\UF071";
Related Topics
Swift - How to Save Memory Using Alamofireimage/Imageshack
How to Load a Url Link That Is Inside a Web View and Keep It in That Web View in Swift
Recursivedescription Method in Swift
Disabling Nslog for Production in Swift Project
Swiftui Holding Reference to Deleted Core Data Object Causing Crash
Check If User Is Logged into Icloud? Swift/Ios
How to Use Sfsafariviewcontroller with Swiftui
<Input Type="Number"/> Is Not Showing a Number Keypad on iOS
While Scrolling on an iOS Device, the Z-Index of Elements Isn't Working
Webkit Overflow Scrolling Touch CSS Bug on iPad
Uiview Backgroundcolor Disappears When Uitableviewcell Is Selected
Convert Uiimage to Nsdata and Convert Back to Uiimage in Swift
Uploading Archive Error: "Missing iOS Distribution Signing Identity for ..."
Default Tab Bar Item Colors Using Swift Xcode 6