-
-
Notifications
You must be signed in to change notification settings - Fork 600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
😲 Emoji characters in keys & values in v4 are lost/corrupted #814
Comments
cat emojifile.yaml | yq eval -M
|
BUT -j (json) apparently works $ cat emojifile.yaml | yq eval -j {
"bash.🔨/init.10级.🥾.b00t.sh": "",
"bash.🔨/init.20级.🐧.linux.sh": "",
"bash.🔨/init.22级.🐙.git.sh": "",
"bash.🔨/init.30级.🐳.层.docker.sh": "",
"bash.🔨/init.32级.💠.层.hashicorp.sh": "",
"bash.🔨/init.40级.🐍.语.python.sh": "",
"bash.🔨/init.40级.🚀.语.node.sh": "",
"bash.🔨/init.42级.🦄.语.typescript.sh": "",
"bash.🔨/init.43级.🥷.语.vue.sh": "",
"bash.🔨/init.44级.☕.语.java.sh": "",
"bash.🔨/init.44级.🏇.语.go.sh": "",
"bash.🔨/init.50级.👾.云☁️.gcp.sh": "",
"bash.🔨/init.50级.🤖.云☁️.azure.sh": "",
"bash.🔨/init.50级.🦉.云☁️.aws.sh": "",
"bash.🔨/init.60级.🎙️💙.应用.vscode.sh": "",
"bash.🔨/init.70级.☎️.msg.sh": "",
"bash.🔨/init.70级.🎬.video.sh": "",
"bash.🔨/init.70级.📱.mobile.sh": "",
"bash.🔨/init.70级.🕹️.gamesim.sh": "",
"bash.🔨/init.70级.🤑.ecommerce.sh": "",
"bash.🔨/init.70级.🥯.crypto.sh": "",
"bash.🔨/init.70级.🧠.ai.sh": "",
"bash.🔨/init.80级.🐱💻.esp32.sh": ""
} |
Just confirmed same behavior on yq 4.8.0 |
Just confirmed that the "other" yq project works properly with Emoji. When I said "earlier" versions worked, that was incorrect. |
Digging a little into this - and as far as I can tell it's an issue with go-yaml, the underlying yaml parser :( Not sure if I'll be able to work around it |
Raised a new issue here: go-yaml/yaml#737 |
Note that '-j' works because the issue is with the yaml Encoder and the json encoder works fine. |
if use shell, could used this command
|
I found a small workaround. You can wrap it with echo -e "$(cat emojifile.yaml | yq eval)" |
The way yq v4 handles emoji is odd, inconsistent, unpredictable (which did not occur on earlier yq 2x versions which had other limitations)
yq should (imho) pass utf8/emoji through unmolested. yq works properly with pinyin (chinese mandarin) fonts but ideograms are so much more powerful and universal it'd be nice to use them with.
For example let's say
emojifile.yaml
with contents:then
will produce (on my ubuntu system)
This is for b00t framework.
The text was updated successfully, but these errors were encountered: