Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Commit fe61321

Browse files
authored
Merge pull request #232 from UnityTech/emoji_new
Fix emoji bug: range covers some Chinese symbols.
2 parents 944fe51 + 2a1ca29 commit fe61321

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Runtime/ui/txt/emoji.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,11 @@ public static Rect getUVRect(int code) {
255255
}
256256

257257
public static bool isSingleCharEmoji(int c) {
258-
return (0x2100 <= c && c < 0x3300) || isEmptyEmoji(c);
258+
return isSingleCharNonEmptyEmoji(c) || isEmptyEmoji(c);
259259
}
260260

261261
public static bool isSingleCharNonEmptyEmoji(int c) {
262-
return 0x2100 <= c && c < 0x3300;
262+
return emojiLookupTable.ContainsKey(c);
263263
}
264264

265265
public static bool isEmptyEmoji(int c) {
@@ -290,6 +290,8 @@ public static List<string> splitByEmoji(string text) {
290290
start = i;
291291
}
292292
}
293+
294+
currentEmoji = true;
293295
}
294296
else {
295297
if (currentEmoji != false) {

0 commit comments

Comments
 (0)