Skip to content

Emojis get escaped when serializing #400

@ahartwel

Description

@ahartwel

If a yaml string has emojis inside of it, after running serialize they are escaped in the final output.

For example

this:

test:
  a_key: "hello 🥹"
  another:
    test: "test"
    test2: "test2"

gets turned into

test:
  a_key: "hello \U0001F979"
  another:
    test: "test"
    test2: "test2"

after going through a Yams.compose -> Yams.serialize cycle.

Here's a simple repro:

let yaml = """
test:
  a_key: "hello 🥹"
  another:
    test: "test"
    test2: "test2"
"""

let node = try Yams.compose(yaml: yaml)
let newString = try Yams.serialize(node: node!, allowUnicode: true)
print(newString)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions