hibye
hibye

Reputation: 57

Why do twemoji fails with most of emoji unicodes?

I am using the library twemoji in my project.

Now, the examples in GitHub work fine on my local computer, but if I try this: twemoji.parse('\u1f600') I get a weird result: ὠ0.

It seems to me that this library works fine for 4 digits unicodes but fails with 5 digits unicodes.

How to solve this?

Upvotes: 2

Views: 459

Answers (1)

deamentiaemundi
deamentiaemundi

Reputation: 5525

ECMA-script uses 16 bit unicode (UTF16), so '\u1f600' indeed parses as ὠ0. twemoji has a conversion utility convert.fromCodePoint(STRING). You might give it a try with convert.fromCodePoint('1f600') (no leading \u!).

Upvotes: 2

Related Questions