Closed ahmedkhalf closed 3 years ago
What is the raw header value?
header.Get("From")
log.Println(header.Get("From"))
2021/03/15 15:15:59 "=?utf-8?q?=E2=99=9F?=Chess.com" <alert@chess.com>
The name is quoted. UTF-8 escaping can't happen inside of quoted strings. The original header is broken.
But what do I do now? This is comes from outlook.. Is there any other alternative in go-imap to fetch the name?
Outlook well known for correctly implementing RFCs as always…
If you really want to work around the issue you can pass the value through textproto.WordDecoder
again. This isn't a patch I'd accept upstream though.
Here is the name of the email I am trying to decode:
♟Chess.com
My code:output:
I tried use from.Name as suggested here (https://github.com/emersion/go-message/issues/132#issuecomment-788762616). But still doesn't work: (https://github.com/emersion/go-message/issues/132#issuecomment-799321271)