Documentation
¶
Overview ¶
Package quotedprintable implements quoted-printable encoding as specified by RFC 2045.
Index ¶
Constants ¶
const ( // BEncoding represents Base64 encoding scheme as defined by RFC 2045. BEncoding = WordEncoder('b') // QEncoding represents the Q-encoding scheme as defined by RFC 2047. QEncoding = WordEncoder('q') )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader is a quoted-printable decoder.
type WordDecoder ¶
type WordDecoder struct { // CharsetReader, if non-nil, defines a function to generate // charset-conversion readers, converting from the provided // charset into UTF-8. // Charsets are always lower-case. utf-8, iso-8859-1 and us-ascii charsets // are handled by default. // One of the the CharsetReader's result values must be non-nil. CharsetReader func(charset string, input io.Reader) (io.Reader, error) }
A WordDecoder decodes MIME headers containing RFC 2047 encoded-words.
func (*WordDecoder) Decode ¶
func (d *WordDecoder) Decode(word string) (string, error)
Decode decodes an encoded-word. If word is not a valid RFC 2047 encoded-word, word is returned unchanged.
func (*WordDecoder) DecodeHeader ¶
func (d *WordDecoder) DecodeHeader(header string) (string, error)
DecodeHeader decodes all encoded-words of the given string. It returns an error if and only if CharsetReader of d returns an error.
type WordEncoder ¶
type WordEncoder byte
A WordEncoder is a RFC 2047 encoded-word encoder.
func (WordEncoder) Encode ¶
func (e WordEncoder) Encode(charset, s string) string
Encode returns the encoded-word form of s. If s is ASCII without special characters, it is returned unchanged. The provided charset is the IANA charset name of s. It is case insensitive.
type Writer ¶
type Writer struct { // Binary mode treats the writer's input as pure binary and processes end of // line bytes as binary data. Binary bool // contains filtered or unexported fields }
A Writer is a quoted-printable writer that implements io.WriteCloser.