Skip to content

Support encoding emojis without encoding as surrogate pairs #368

@tech4him1

Description

@tech4him1

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions