package utf7

import "github.com/emersion/go-imap/v2/internal/utf7"

Package utf7 implements modified UTF-7 encoding defined in RFC 3501 section 5.1.3

Index

Variables

var ErrInvalidUTF7 = errors.New("utf7: invalid UTF-7")

ErrInvalidUTF7 means that a decoder encountered invalid UTF-7.

Functions

func Decode

func Decode(src string) (string, error)

Decode decodes a string encoded with modified UTF-7.

Note, raw UTF-8 is accepted.

func Encode

func Encode(src string) string

Encode encodes a string with modified UTF-7.

func Escape

func Escape(src string) string

Escape passes through raw UTF-8 as-is and escapes the special UTF-7 marker (the ampersand character).

Source Files

decoder.go encoder.go utf7.go

Version
v2.0.0-beta.5 (latest)
Published
Feb 14, 2025
Platform
linux/amd64
Imports
5 packages
Last checked
2 days ago

Tools for package owners.