decode

package
v0.99.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNop

func IsNop(enc string) bool

func LookupEncoding

func LookupEncoding(enc string) (encoding.Encoding, error)

LookupEncoding attempts to match the string name provided with a character set encoding.

Types

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

func New

func New(enc encoding.Encoding) *Decoder

New wraps a character set encoding and creates a reusable buffer to reduce allocation. Decoder is not thread-safe and must not be used in multiple goroutines.

func (*Decoder) Decode

func (d *Decoder) Decode(msgBuf []byte) ([]byte, error)

Decode converts the bytes in msgBuf to UTF-8 from the configured encoding.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL