dasel icon indicating copy to clipboard operation
dasel copied to clipboard

Emoji is changed to Unicode in yaml

Open zydou opened this issue 1 year ago β€’ 2 comments

Describe the bug Emoji is changed to Unicode in yaml

To Reproduce

$ cat flag.json
{
  "US": "πŸ‡ΊπŸ‡Έ",
  "CN": "πŸ‡¨πŸ‡³"
}

$ dasel -f flag.json -w yaml
US: "\U0001F1FA\U0001F1F8"
CN: "\U0001F1E8\U0001F1F3"

$ dasel -f flag.json -w toml
CN = 'πŸ‡¨πŸ‡³'
US = 'πŸ‡ΊπŸ‡Έ'

Expected behavior Emoji remains unchanged in yaml

Desktop (please complete the following information):

  • OS: Ubuntu 24.04
  • Version: v2.8.1
  • Terminal: Wezterm 20240203-110809-5046fc22

zydou avatar Oct 18 '24 03:10 zydou

This is caused by the imported YAML parser: https://github.com/go-yaml/yaml/issues/737

It looks like there's a potential fix in https://github.com/go-yaml/yaml/pull/738, however it's still waiting for review and merge years later.

TomWright avatar Oct 31 '24 16:10 TomWright

I've deleted the comment above because of safety concerns. It contained a phishing/malicious link.

TomWright avatar Oct 31 '24 18:10 TomWright