Documentation ¶
Overview ¶
Package enca provides a minimal cgo bindings for libenca
Source code and project home: https://github.com/endeveit/go-enca
Index ¶
Constants ¶
View Source
const ( // Default, implicit charset name in Enca NAME_STYLE_ENCA = 0 << iota // RFC 1345 or otherwise canonical charset name NAME_STYLE_RFC1345 // Cstocs charset name (may not exist) NAME_STYLE_CSTOCS // Iconv charset name (may not exist) NAME_STYLE_ICONV // Human comprehensible description NAME_STYLE_HUMAN // Preferred MIME name (may not exist) NAME_STYLE_MIME )
Variables ¶
This section is empty.
Functions ¶
func GetAvailableLanguages ¶
func GetAvailableLanguages() []string
Returns list of available languages
Types ¶
type EncaAnalyser ¶
type EncaAnalyser struct { sync.Mutex // Language for which the analyser is initialized Language string // contains filtered or unexported fields }
func New ¶
func New(lang string) (*EncaAnalyser, error)
Returns a new EncaAnalyzer object for the given language.
func (*EncaAnalyser) FromBytes ¶
func (ea *EncaAnalyser) FromBytes(bytes []byte, nameStyle int) (result string, err error)
Returns encoding of provided byte array
func (*EncaAnalyser) FromString ¶
func (ea *EncaAnalyser) FromString(text string, nameStyle int) (string, error)
Helper function that returns encoding of provided string
Click to show internal directories.
Click to hide internal directories.