package quotedprintable
Import Path
mime/quotedprintable (on go.dev)
Dependency Relation
imports 4 packages, and imported by one package
Involved Source Files
Package quotedprintable implements quoted-printable encoding as specified by
RFC 2045.
writer.go
Code Examples
package main
import (
"fmt"
"io"
"mime/quotedprintable"
"strings"
)
func main() {
for _, s := range []string{
`=48=65=6C=6C=6F=2C=20=47=6F=70=68=65=72=73=21`,
`invalid escape: <b style="font-size: 200%">hello</b>`,
"Hello, Gophers! This symbol will be unescaped: =3D and this will be written in =\r\none line.",
} {
b, err := io.ReadAll(quotedprintable.NewReader(strings.NewReader(s)))
fmt.Printf("%s %v\n", b, err)
}
}
package main
import (
"mime/quotedprintable"
"os"
)
func main() {
w := quotedprintable.NewWriter(os.Stdout)
w.Write([]byte("These symbols will be escaped: = \t"))
w.Close()
}
Package-Level Type Names (total 2, both are exported)
Reader is a quoted-printable decoder.
br *bufio.Reader
// to be consumed before more of br
// last read error
Read reads and decodes quoted-printable data from the underlying reader.
*Reader : io.Reader
func NewReader(r io.Reader) *Reader
A Writer is a quoted-printable writer that implements [io.WriteCloser].
Binary mode treats the writer's input as pure binary and processes end of
line bytes as binary data.
cr bool
i int
line [78]byte
w io.Writer
Close closes the [Writer], flushing any unwritten data to the underlying
[io.Writer], but does not close the underlying io.Writer.
Write encodes p using quoted-printable encoding and writes it to the
underlying [io.Writer]. It limits line length to 76 characters. The encoded
bytes are not necessarily flushed until the [Writer] is closed.
checkLastByte encodes the last buffered byte if it is a space or a tab.
(*Writer) encode(b byte) error
(*Writer) flush() error
(*Writer) insertCRLF() error
(*Writer) insertSoftLineBreak() error
write limits text encoded in quoted-printable to 76 characters per line.
*Writer : internal/bisect.Writer
*Writer : io.Closer
*Writer : io.WriteCloser
*Writer : io.Writer
*Writer : crypto/tls.transcriptHash
func NewWriter(w io.Writer) *Writer
Package-Level Functions (total 6, in which 2 are exported)
NewReader returns a quoted-printable reader, decoding from r.
NewWriter returns a new [Writer] that writes to w.
Package-Level Variables (total 3, none are exported)
Package-Level Constants (total 2, neither is exported)
![]() |
The pages are generated with Golds v0.7.6. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |