leeoniya/uFuzzy

Emoji matching doesn't work on Safari

ocavue opened this issue ยท 4 comments

Open https://stackblitz.com/edit/vitejs-vite-ykkskh in Safari / Chrome / Firefox

Both Chrome and Firefox can show "result: ๐ŸŽ" as expected, but Safari shows empty result.

After some digging, I found that Safari output different result for the following JS code:

const s = "๐ŸŽ".replace(/^[^\p{Emoji}]+|[^\p{Emoji}]+$/u, "")

for (let i = 0; i < s.length; i++) {
  console.log(s.codePointAt(i))
}
// Safari output:
55356

// Chrome and Firefox output:
127822 
57166 

It seems that this is a Safari bug. I will try to find or create a issue ticket to the WebKit team.

Update: I created a WebKit ticket https://bugs.webkit.org/show_bug.cgi?id=272546

So I could not reproduce in STP 192.

@ocavue which versions of Safari did you use? which device too?

Screenshot 2024-04-12 at 14 07 14 It may have been fixed recently.

image

Yes you're correct. This issue doesn't occur on STP 192. Sorry for the disturbance, I should have tried the latest STP from the beginning.