Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToUTF8String ¶
ConvertToUTF8String uses the provided charset to decode a slice of bytes into a normal UTF-8 string.
func FindCharsetInHTML ¶
FindCharsetInHTML looks for charset in the HTML meta tag (v4.01 and v5).
func FromIDHeader ¶
FromIDHeader decodes a Content-ID or Message-ID header value (RFC 2392) into a utf-8 string. Example: "<foo%3fbar+baz>" becomes "foo?bar baz".
func NewCharsetReader ¶
NewCharsetReader generates charset-conversion readers, converting from the provided charset into UTF-8. CharsetReader is a factory signature defined by Go's mime.WordDecoder.
This function is similar to: https://godoc.org/golang.org/x/net/html/charset#NewReaderLabel
func ToIDHeader ¶
ToIDHeader encodes a Content-ID or Message-ID header value (RFC 2392) from a utf-8 string.
Types ¶
type Base64Cleaner ¶
type Base64Cleaner struct { // Report of non-whitespace characters detected while cleaning base64 data. Errors []error // contains filtered or unexported fields }
Base64Cleaner improves the tolerance of in Go's built-in base64 decoder by stripping out characters that would cause decoding to fail.
func NewBase64Cleaner ¶
func NewBase64Cleaner(r io.Reader) *Base64Cleaner
NewBase64Cleaner returns a Base64Cleaner object for the specified reader. Base64Cleaner implements the io.Reader interface.
type QPCleaner ¶
type QPCleaner struct {
// contains filtered or unexported fields
}
QPCleaner scans quoted printable content for invalid characters and encodes them so that Go's quoted-printable decoder does not abort with an error.
func NewQPCleaner ¶
NewQPCleaner returns a QPCleaner for the specified reader.