Documentation ¶
Index ¶
- Variables
- func CharsetReader(charset string, input io.Reader) (io.Reader, error)
- func DecodeCharset(original []byte, contentType string) ([]byte, error)
- func DecodeHeader(raw string) (decoded string, err error)
- func EncodeHeader(s string) string
- func NewUtf7Decoder() *encoding.Decoder
- func ParseMediaType(v string) (mediatype string, params map[string]string, err error)
- func SelectDecoder(charset string) (decoder *encoding.Decoder, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBadUTF7 = errors.New("utf7: bad utf-7 encoding")
ErrBadUTF7 is returned to indicate the invalid modified UTF-7 encoding.
View Source
var WordDec = &mime.WordDecoder{ CharsetReader: CharsetReader, }
Functions ¶
func DecodeCharset ¶
DecodeCharset decodes the orginal using content type parameters. If the charset parameter is missing it checks that the content is valid utf8. If it isn't, it checks if it's embedded in the html/xml. If it isn't, it falls back to windows-1252. It then reencodes it as utf-8.
func DecodeHeader ¶
DecodeHeader if needed. Returns error if raw contains non-utf8 characters.
func EncodeHeader ¶
EncodeHeader using quoted printable and utf8.
func NewUtf7Decoder ¶
NewUtf7Decoder returns a new decoder for utf7.
func ParseMediaType ¶
ParseMediaType from MIME doesn't support RFC2231 for non asci / utf8 encodings so we have to pre-parse it.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.