When you type a two spaces in a row in an html email in Gmail it encodes it into the quoted-printable body as "=C2=A0 " if you look at the source of the email.
According to this stackoverflow answer, because of the UTF-8 encoding this should be converted to 00A0 (nbsp) when decoded: https://stackoverflow.com/a/2774507
However, in Golang, this isn't how it works:
s := `Text Text Text.=C2=A0 That's just two spaces`
r := strings.NewReader(s)
qpReader := quotedprintable.NewReader(r)
all, _ := ioutil.ReadAll(qpReader)
str := string(all)
fmt.Println(strings.Index(str, "\xC2\xA0"))
This outputs "15", here's the Playground link: https://play.golang.org/p/8n6L7dlZPt
Instead of it using an NBSP there, it will keep the \xC2 and result in "Text Text Text That's just two spaces".
What's the best way to correctly render this as \x00A0?