Skip to content

Commit e99bc16

Browse files
authored
Merge pull request #275 from supertassu/master
make: MIME-encode sender name when necessary
2 parents 5695d13 + 7336d8b commit e99bc16

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

make.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"fmt"
77
"io"
88
"log"
9+
"mime"
910
"net/http"
1011
"net/url"
1112
"os"
@@ -689,9 +690,11 @@ func writeITP(gopkg, debsrc, debversion string) (string, error) {
689690
description = "TODO"
690691
}
691692

692-
fmt.Fprintf(f, "From: %q <%s>\n", getDebianName(), getDebianEmail())
693+
subject := mime.QEncoding.Encode("utf-8", fmt.Sprintf("ITP: %s -- %s", debsrc, description))
694+
695+
fmt.Fprintf(f, "From: %q <%s>\n", mime.QEncoding.Encode("utf-8", getDebianName()), getDebianEmail())
693696
fmt.Fprintf(f, "To: [email protected]\n")
694-
fmt.Fprintf(f, "Subject: ITP: %s -- %s\n", debsrc, description)
697+
fmt.Fprintf(f, "Subject: %s\n", subject)
695698
fmt.Fprintf(f, "Content-Type: text/plain; charset=utf-8\n")
696699
fmt.Fprintf(f, "Content-Transfer-Encoding: 8bit\n")
697700
fmt.Fprintf(f, "X-Debbugs-CC: [email protected], [email protected]\n")

0 commit comments

Comments
 (0)