Emoji matching doesn't work on Safari
ocavue opened this issue ยท 4 comments
ocavue commented
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
karlcow commented
So I could not reproduce in STP 192.
karlcow commented
ocavue commented