chardet

package
v0.0.0-...-2658d01 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotDetected = chardet.NotDetectedError

Functions

func DetermineEncoding

func DetermineEncoding(content []byte, contentType string, detect func([]byte) (encoding.Encoding, string)) (e encoding.Encoding, name string, certain bool)

Types

type Detector

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

func NewDetector

func NewDetector(opts ...DetectorOption) *Detector

func (Detector) DetectEncoding

func (d Detector) DetectEncoding(b []byte) (encoding.Encoding, string)

type DetectorOption

type DetectorOption func(resultFilter) resultFilter

func WithCharset

func WithCharset(charsets ...string) DetectorOption

func WithLanguage

func WithLanguage(langs ...string) DetectorOption

func WithPrefer

func WithPrefer(f func(a, b chardet.Result) bool) DetectorOption

Jump to

Keyboard shortcuts

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