Currently, if an emoji is in a YAML string, and run through safeDump, it will be converted into escaped surrogate pairs (i.e. thiskey: "😀" is dumped as thiskey: "\uD83D\uDE00"). This is caused by lib/js-yaml/dumper.js#L468, as using JS charCodeAt returns surrogate pairs by default (see https://mathiasbynens.be/notes/javascript-unicode). Would you be willing to at least make this configurable, so that we could choose whether to convert into surrogate pairs or write the emojis directly? If you want a PR, I can help with that as well, just wanted to see what your thoughts were.
Currently, if an emoji is in a YAML string, and run through
safeDump, it will be converted into escaped surrogate pairs (i.e.thiskey: "😀"is dumped asthiskey: "\uD83D\uDE00"). This is caused by lib/js-yaml/dumper.js#L468, as using JScharCodeAtreturns surrogate pairs by default (see https://mathiasbynens.be/notes/javascript-unicode). Would you be willing to at least make this configurable, so that we could choose whether to convert into surrogate pairs or write the emojis directly? If you want a PR, I can help with that as well, just wanted to see what your thoughts were.