Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Emoji serialized to Unicode escape sequence #356

Closed
inflation opened this issue Mar 1, 2023 · 1 comment · Fixed by #358
Closed

Emoji serialized to Unicode escape sequence #356

inflation opened this issue Mar 1, 2023 · 1 comment · Fixed by #358

Comments

@inflation
Copy link

inflation commented Mar 1, 2023

I have some cursed configs with emojis (don't ask me why), and need to patch those files without touching other parts. It's all good until the last serialize part. Those emojis are converted to Unicode escape sequence:

let test = '🎉';
println!("{}", serde_yaml::to_string(&test).unwrap());

Output: "\U0001F389"

Although, it's technically equivalent but not very human-readable. PyYAML has an option allow_unicode for dump to keep them. I'd love to see a similar option for serde-yaml.

@dtolnay
Copy link
Owner

dtolnay commented Mar 5, 2023

Fixed in serde_yaml 0.9.18.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants