psych icon indicating copy to clipboard operation
psych copied to clipboard

Psych.dump convert emoji characters into unicode

Open neumayr opened this issue 7 years ago β€’ 4 comments

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

  • https://r12a.github.io/app-conversion/

✨ Please let emojis live in yaml files. πŸ’™ πŸ’š πŸ’› πŸ’œ


Note This issue was moved from https://github.com/glebm/i18n-tasks/issues/291

neumayr avatar Aug 21 '18 08:08 neumayr

Hi, has there been any progress made on this?

jkostolansky avatar Apr 09 '19 08:04 jkostolansky

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

forelabs avatar Jan 08 '20 14:01 forelabs

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") }

bibendi avatar Oct 20 '21 09:10 bibendi