Skip to content
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

Psych.dump convert emoji characters into unicode #371

Open
neumayr opened this issue Aug 21, 2018 · 4 comments
Open

Psych.dump convert emoji characters into unicode #371

neumayr opened this issue Aug 21, 2018 · 4 comments

Comments

@neumayr
Copy link

neumayr commented Aug 21, 2018

Hey! 🙌

The origin of this issue is i18n-tasks which delegates YAML dumping to this library.

I've spotted that i18n-tasks normalize converts emoji characters into unicode which makes them much harder to read and change afterward. IMHO, this should be necessary because yaml is capable to understand plain emoji chars. What do you think about this one?

Before
lang:
  de-de: 🇩🇪 German
  en-uk: 🇺🇸 English
  header: 🌐 Select Language
After i18n-tasks normalize / Psych.dump
lang:
  de-de: "\U0001F1E9\U0001F1EA German"
  en-uk: "\U0001F1FA\U0001F1F8 English"
  header: "\U0001F310 Select Language"

Converter tool

✨ Please let emojis live in yaml files. 💙 💚 💛 💜


Note This issue was moved from glebm/i18n-tasks#291

@jkostolansky
Copy link

Hi, has there been any progress made on this?

@forelabs
Copy link

forelabs commented Jan 8, 2020

Upvote for having emojis in yaml files. It's 2020, emojis are basically everywhere. Would be nice to have this supported.

@bibendi
Copy link

bibendi commented Oct 20, 2021

It's 2021, emojis rule the world.
My workaround is:

data.to_yaml.gsub(/\\u[\da-f]{8}/i) { |m| [m[-8..].to_i(16)].pack("U") }

@DTrejo
Copy link

DTrejo commented Jan 23, 2023

FYI, happens with some emoji like 🔧, but not others. Thanks for the fix @bibendi !

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

No branches or pull requests

5 participants