mathiasbynens/punycode.js

Wrong conversion of secondary set of emojis (UCS2)

Closed this issue Β· 1 comments

when i run the punycode.ucs2.decode

("This is a message with emoji 😊 ⚽ β›„πŸŽΈ πŸ˜†) πŸ˜‡ 😈 πŸ˜‰ 😊 πŸ˜‹ 😌 😍")

i'm obtaining numbers greater than 0xFFFF (65536) . That is wrong because we need to convert between code points and surrogate pairs as document https://mathiasbynens.be/notes/javascript-encoding

The inverse function runs without problem.

It looks like it is happening with secondary set of emojis in the document.

http://www.unicode.org/Public/emoji/1.0/emoji-data.txt

i'm obtaining numbers greater than 0xFFFF (65536) .

That’s the point: https://github.com/bestiejs/punycode.js#punycodeucs2decodestring

What output would you expect?