4 ms·
As JSON must be in Unicode (I think the latest RFC restricts it to UTF-8), there's no actual _need_ to escape emoji. But if you do need to (perhaps you're in an
by TRiG_Ireland 3y ago
As JSON must be in Unicode (I think the latest RFC restricts it to UTF-8), there's no actual _need_ to escape emoji. But if you do need to (perhaps you're in an ASCII-only environment), you have to do it that way, yes. Weird. (I asked once, on Stack Overflow, why this was the case, and was merely told that it was historical reasons, which matches what you surmised: it's a relic.)
- poorlyknit 3y agoRight! In practice you'd just put the symbols directly. Funnily enough {"text": "\ud83e\udd14"} is the only way to encode the JSON from my post on HN :D