Documentation ¶
Overview ¶
Package chardet ports character set detection from ICU.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEndOfInputBuffer = errors.New("end of input buffer") ErrBadCharDecode = errors.New("decode a bad char") )
View Source
var (
ErrNotDetected = errors.New("charset not detected")
)
Functions ¶
func DecodeFromCharset ¶
DecodeFromCharset decode input to utf8
func EncodeToCharset ¶
EncodeToCharset encode input to charset
Types ¶
type Detector ¶
type Detector struct {
// contains filtered or unexported fields
}
Detector implements charset detection.
func NewHtmlDetector ¶
func NewHtmlDetector() *Detector
NewHtmlDetector creates a Detector for Html.
func NewTextDetector ¶
func NewTextDetector() *Detector
NewTextDetector creates a Detector for plain text.
type Result ¶
type Result struct { // IANA name of the detected charset. Charset string // IANA name of the detected language. It may be empty for some charsets. Language string // Confidence of the Result. Scale from 1 to 100. The bigger, the more confident. Confidence int }
Result contains all the information that charset detector gives.
Click to show internal directories.
Click to hide internal directories.