Add emoji support in email subjects#25
Merged
bluekeyes merged 6 commits intobluekeyes:masterfrom Jul 19, 2021
Merged
Conversation
Owner
|
Thanks for fixing this. Looking through I think if we want a complete solution here, it would be nice to implement additional decoding:
That said, if UTF-8 is the most common, it might be fine to skip decoding in non-UTF-8 cases and leave this as a future improvement. |
bluekeyes
reviewed
Jul 19, 2021
gitdiff/patch_header.go
Outdated
| // Decodes a subject line if encoded using quoted-printable UTF-8 Q encoding. This format is the | ||
| // result of a `git format-patch` when the commit title has an emoji (or other non-ASCII character). | ||
| // See for reference: https://stackoverflow.com/questions/27695749/gmail-api-not-respecting-utf-encoding-in-subject | ||
| func decodeUTF8Subject(encoded string) string { |
Owner
There was a problem hiding this comment.
Let's call this decodeSubject so it could be expanded for more encodings, either now or in the future.
bluekeyes
approved these changes
Jul 19, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using
git format-patchto produce email patches, the subject line will be encoded if any extended characters are present (i.e. emoji). This PR decodes those values for the subject, producing the original subject, including any emoji/other-characters.