charset

package
v0.6.32 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: AGPL-3.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(fromEnc string, toEnc string, b []byte) ([]byte, error)

func DetectText

func DetectText(content []byte) (string, error)

func Encoding

func Encoding(charset string) encoding.Encoding

func NewConvertBytesFunc

func NewConvertBytesFunc(fromEnc string, toEnc string) (func([]byte) []byte, error)

func NewConvertFunc

func NewConvertFunc(fromEnc string, toEnc string) (func(string) string, error)

func NewDecoderAndEncoder

func NewDecoderAndEncoder(fromEnc string, toEnc string) (mahonia.Decoder, mahonia.Encoder, error)

func NewTransformBytesFunc

func NewTransformBytesFunc(charset string) (func([]byte) ([]byte, error), error)

func NewTransformFunc

func NewTransformFunc(charset string) (func(string) (string, error), error)

func NewTransformReader

func NewTransformReader(charset string, src io.Reader) (io.Reader, error)

func NewTransformWriter

func NewTransformWriter(charset string, dst io.WriteCloser) (io.WriteCloser, error)

func Register

func Register(charset string, encoding encoding.Encoding, alias ...string)

func RuneWith

func RuneWith(str string) int

func Supported

func Supported() []string

func Transform

func Transform(charset string, content string) (string, error)

func TransformBytes

func TransformBytes(charset string, content []byte) ([]byte, error)

func Truncate

func Truncate(str string, width int) string

func Validate

func Validate(enc string) bool

func With

func With(str string) int

Types

This section is empty.

Jump to

Keyboard shortcuts

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