Standard library / mime/quotedprintable

quotedprintable.NewReader()

Wrap a reader to decode quoted-printable body bytes. Bound untrusted source data and inspect errors. Expected stdout: 'café\n'.

Formal Syntax & Structure

go syntaxgo
func NewReader(r io.Reader) *Reader

Parameters & Attributes

NameTypeDescription
rio.ReaderUnderlying input stream; bound untrusted input before parsing.

Return Value

*Reader

Reader wrapping the supplied input.

Working Example

Example Snippetgo
package main
import (  "fmt"  "io"  "mime/quotedprintable"  "strings")
func main() {  r := quotedprintable.NewReader(strings.NewReader("caf=C3=A9"))  fmt.Println(string(must(io.ReadAll(r))))}
func must[T any](v T, e error) T {  if e != nil {    panic(e)  }  return v}func check(e error) {  if e != nil {    panic(e)  }}
Go Reference