jhillyerd / enmime

MIME mail encoding and decoding package for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

International file name handling during encode

jhillyerd opened this issue · comments

Golang's mime.FormatMediaType does not handle non-ASCII characters. PR #54 escapes non-ASCII characters with \u1234 notation.

RFC 2616 sec 2.2 does not define any special meaning for backslash quoted characters. In other applications I've seen non-ASCII characters converted to underscores for filenames, but I feel we can do better.

My suggestion is to remove all accent marks from alphabetic characters (ie À -> A, ó -> o), then convert any remaining non-ASCII characters to underscores.