go-gitdiff icon indicating copy to clipboard operation
go-gitdiff copied to clipboard

Implement full decoding support for patch subjects

Open bluekeyes opened this issue 3 years ago • 0 comments

Looking through decode_header in the Git source, it looks like there are several possible encodings. Currently, we only support quoted-printable UTF-8 and ignore anything else (implemented in #25.)

To support arbitrary encodings, I think we need to:

  1. Identify the encoding from the text between the first =? and the next ?
  2. Use the q? or b? to determine if the content until the next =? is encoded as quoted-printable or base64
  3. Decode the content
  4. Use ianaindex.MIME to look up the encoding
  5. Use the encoding from to convert the bytes to UTF-8

bluekeyes avatar Jul 19 '21 18:07 bluekeyes