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.
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:
Output:
"\U0001F389"
Although, it's technically equivalent but not very human-readable. PyYAML has an option
allow_unicode
fordump
to keep them. I'd love to see a similar option forserde-yaml
.