1
2
3
4
5 package quotedprintable_test
6
7 import (
8 "fmt"
9 "io"
10 "mime/quotedprintable"
11 "os"
12 "strings"
13 )
14
15 func ExampleNewReader() {
16 for _, s := range []string{
17 `=48=65=6C=6C=6F=2C=20=47=6F=70=68=65=72=73=21`,
18 `invalid escape: <b style="font-size: 200%">hello</b>`,
19 "Hello, Gophers! This symbol will be unescaped: =3D and this will be written in =\r\none line.",
20 } {
21 b, err := io.ReadAll(quotedprintable.NewReader(strings.NewReader(s)))
22 fmt.Printf("%s %v\n", b, err)
23 }
24
25
26
27
28 }
29
30 func ExampleNewWriter() {
31 w := quotedprintable.NewWriter(os.Stdout)
32 w.Write([]byte("These symbols will be escaped: = \t"))
33 w.Close()
34
35
36
37 }
38
View as plain text