utf8safe-uhex
Hex-escape (\uHHHH) those UCS-2 characters that cannot be encoded as UTF-8, and the replacement character, to help you distinguish verbatim occurrences from freshly discarded data.
Usage
trom test.js:
var utf8safe_uhex = orig = "\uD83D\uDC15\u2771" + "\uDC15" + "\uD83D" + "\u2770\uD83D\uDC04" expect = actual = ; ;
License
ISC