12345678910111213141516171819 |
- package encoding
- import (
- "github.com/flashmob/go-guerrilla/mail"
- "strings"
- "testing"
- )
- // This will use the golang.org/x/net/html/charset encoder
- func TestEncodingMimeHeaderDecode(t *testing.T) {
- str := mail.MimeHeaderDecode("=?ISO-2022-JP?B?GyRCIVo9dztSOWJAOCVBJWMbKEI=?=")
- if i := strings.Index(str, "【女子高生チャ"); i != 0 {
- t.Error("expecting 【女子高生チャ, got:", str)
- }
- str = mail.MimeHeaderDecode("=?ISO-8859-1?Q?Andr=E9?= Pirard <[email protected]>")
- if strings.Index(str, "André Pirard") != 0 {
- t.Error("expecting André Pirard, got:", str)
- }
- }
|