mixpanel-js
mixpanel-js copied to clipboard
JSON Encoder breaks unicode characters on emojis 🌳
Hi, I'm working on Mixpanel proxy for further analytics and my code is failing to reconstruct input data which contain UTF-8 emojis.
I suspect the root cause is the custom JSON Encoder https://github.com/mixpanel/mixpanel-js/blob/8ac526e5cb8563d11e2206046ab986c6491ac6d7/src/utils.js#L393-L416
which corrupts unicode characters Input
{"event": "🌳"}
Expected output:
{\"event\": \"\xf0\x9f\x8c\xb3\"}
actual SDK output:
{\"event\": \"\xed\xa0\xbc\xed\xbc\xb3\"}