mirror of
https://github.com/mjl-/mox.git
synced 2024-12-25 16:03:48 +03:00
5678b03324
as they occur in From/To headers, for example: "From: =?iso-8859-2?Q?Krist=FDna?= <k@example.com>". we are using net/mail to parse such headers. most address-parsing functions in that package will only decode charsets utf-8, iso-8859-1 and us-ascii. we have to be careful to always use net/mail.AddressParser with a WordDecoder that understands more that the basics. for issue #204 by morki, thanks for reporting!
11 lines
306 B
Go
11 lines
306 B
Go
package message
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestParseAddressList(t *testing.T) {
|
|
l, err := ParseAddressList("=?iso-8859-2?Q?Krist=FDna?= <k@example.com>, mjl@mox.example")
|
|
tcheck(t, err, "parsing address list")
|
|
tcompare(t, l, []Address{{"Kristýna", "k", "example.com"}, {"", "mjl", "mox.example"}})
|
|
}
|