Documentation ¶
Overview ¶
Package chardet ports character set detection from ICU.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
NotDetectedError = errors.New("Charset not detected.")
)
Functions ¶
func DetectFileEncoding ¶
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.