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

hotfix: add utf-8 parsint for emoji_support #40

Merged
merged 2 commits into from Aug 30, 2022

Conversation

braydonk
Copy link
Collaborator

@braydonk braydonk commented Aug 30, 2022

closes #38

There is a major bug in yaml.v3 that makes it incapable of encoding
emojis. There has been an issue and PR open to fix it for a very long
time, but it has still gotten no attention. This PR adds a new hotfix
that will parse the literal \U00000000 codepoint sequences that yaml.v3
produces and outputs the unicode encoding. It can be enabled with the
new emoji_support configuration value for the basic formatter.
Unfortunately, any scalar with an emoji will come out double quoted;
might be able to rectify this but it will be very nasty. Going to accept
that consequence for now to unblock this breakage.

This uses a library I made on my personal account in some spare time I had. https://github.com/RageCage64/go-utf8-codepoint-converter

There is a major bug in yaml.v3 that makes it incapable of encoding
emojis. There has been an issue and PR open to fix it for a very long
time, but it has still gotten no attention. This PR adds a new hotfix
that will parse the literal `\U00000000` codepoint sequences that yaml.v3
produces and outputs the unicode encoding. It can be enabled with the
new `emoji_support` configuration value for the basic formatter.
Unfortunately, any scalar with an emoji will come out double quoted;
might be able to rectify this but it will be very nasty. Going to accept
that consequence for now to unblock this breakage.
It was weird having p.write and a manual p.out append so I wrote a
method for that for consistency.
@braydonk braydonk merged commit d9e8674 into google:main Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Emoji convert to Unicode codepoints
1 participant