Localizing The Reading of Emoji on iOS 10.0 or Higher

Localizing the Reading of Emoji on IOS 10.0 or Higher

UPDATE: Issue appears to be fixed in iOS 13.2! Yay!

UPDATE: After official release of iOS 13, the issue has been eclipsed/superceded by a worse issue (iOS 13 Text To Speech (TTS - AVSpeechSynthesisVoice) crashes for some users after update).

// original post:

After notifying Apple via the Feedback Assistant, it appears that this was a bug introduced somehow in IOS 10 that went unnoticed for three consecutive versions of IOS.

After testing with IOS 13 beta 5 (17A5547d), the issue doesn't appear.

They claim that the issue has been explicitly fixed from this point forward.

ios: localize emoji name (kCFStringTransformToUnicodeName)

There is no api for this job. Unicode character name is standardized only in English.

The macOS use localization files to achieve this.

You can find the location of The CharacterPalette app:

  1. Option+click on the  Apple menu and choose ‘System Information’ (called ‘System Profiler’ in earlier releases of OS X).

  2. From the side menu, look under ‘Software’ and choose “Applications”

My app's location looks like this:

Sample Image

Locate the CharacterPalette.app,right click -> show package,you can find the localization files :

Sample Image

But I can't open it correctly , the file is full of unreadable code.Maybe it's encrypted.

You may have to copy paste the names one by one.

Is there a framework or function for turning emoji into words?

This links to a repository containing the mapping from emoji unicode to description. Also check this answer.

To read it out, get familiar with AvSpeechSynthesizer

How to list (almost) all emojis in Swift for iOS 8 without using any form of lookup tables?

You can loop over those hex values with a Range: 0x1F601...0x1F64F and then create the Strings using a UnicodeScalar:

for i in 0x1F601...0x1F64F {
guard let scalar = UnicodeScalar(i) else { continue }
let c = String(scalar)
print(c)
}

Outputs:

/p>

If you want all the emoji, just add another loop over an array of ranges:

// NOTE: These ranges are still just a subset of all the emoji characters;
// they seem to be all over the place...
let emojiRanges = [
0x1F601...0x1F64F,
0x2702...0x27B0,
0x1F680...0x1F6C0,
0x1F170...0x1F251
]

for range in emojiRanges {
for i in range {
guard let scalar = UnicodeScalar(i) else { continue }
let c = String(scalar)
print(c)
}
}

For those asking, the full list of available emojis can be found here: https://www.unicode.org/emoji/charts/full-emoji-list.html

A parsable list of unicode sequences for all emojis can be found in the emoji-sequences.txt file under the directory for the version you're interested in here: http://unicode.org/Public/emoji/

As of 9/15/2021 the latest version of the emoji standard available on Apple devices is 13.1.

Xcode Objective-C: Text to speech is always in English even if the iPhone is set to another language

You can use [[[NSBundle mainBundle] preferredLocalizations] firstObject] to find the application current language.

(If it's nil or if your app is not localized you can use [[NSLocale currentLocale] languageCode] instead, but this does not take care of the language specified in the settings, whenever the user changes the language of the app only, not for all the device)

This way you can specify the language with [AVSpeechSynthesisVoice voiceWithLanguage:] and be sure you have the app language spoken.

Otherwise you can let the user choose the spoken language.

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 - ;


Related Topics



Leave a reply



Submit