Skip to content

Latest commit

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

enca Build Status

This is a minimal cgo bindings for libenca.

If you need to detect the language of a string you can use guesslanguage package.

Supported Go versions

enca is tested against Go 1.0, 1.1, 1.2, 1.3 and tip.

Usage

Install libenca to your system:

$ sudo apt-get install libenca0 libenca-dev

Install in your ${GOPATH} using go get -u github.com/endeveit/enca

Then call it:

package main
import (
"fmt""github.com/endeveit/enca"
)
funcmain() {
analyzer, err:=enca.New("zh")
iferr==nil {
encoding, err:=analyzer.FromString("美国各州选民今天开始正式投票。据信,", enca.NAME_STYLE_HUMAN)
deferanalyzer.Free()
// Output:// UTF-8iferr==nil {
fmt.Println(encoding)
}
}
}

Documentation

godoc is available here.

About

Minimal cgo bindings for libenca

Resources

Stars

19 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages