1
0
mirror of https://github.com/golang/go synced 2024-11-14 15:00:27 -07:00
go/src/net/mail
Alexandre Cesaro 2cb265d16c net/mail: use base64 encoding when needed in Address.String()
When the name of an Address contains non-ASCII characters,
Address.String() used mime.QEncoding to encode the name.

However certain characters are forbidden when an encoded-word is
in a phrase context (see RFC 2047 section 5.3) and these
characters are not encoded by mime.QEncoding.

In this case we now use mime.BEncoding (base64 encoding) so that
forbidden characters are also encoded.

Fixes #11292

Change-Id: I52db98b41ece439295e97d7e94c8190426f499c2
Reviewed-on: https://go-review.googlesource.com/16012
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-12-02 17:37:36 +00:00
..
example_test.go
message_test.go net/mail: use base64 encoding when needed in Address.String() 2015-12-02 17:37:36 +00:00
message.go net/mail: use base64 encoding when needed in Address.String() 2015-12-02 17:37:36 +00:00