• Alexandre Cesaro's avatar
    net/mail: use base64 encoding when needed in Address.String() · 2cb265d1
    Alexandre Cesaro authored
    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/16012Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    2cb265d1
message.go 14.4 KB