ASCII transliterations of Unicode text.
go get -u github.com/tisorlawan/go-unidecode
Install CLI tool:
go get -u github.com/tisorlawan/go-unidecode/unidecode
$ unidecode 北京
Bei Jing
API documentation can be found here: https://godoc.org/github.com/tisorlawan/go-unidecode
package main
import (
"fmt"
"github.com/tisorlawan/go-unidecode"
)
func main() {
s := "abc"
fmt.Println(unidecode.Unidecode(s))
// Output: abc
s = "北京"
fmt.Println(unidecode.Unidecode(s))
// Output: Bei Jing
s = "kožušček"
fmt.Println(unidecode.Unidecode(s))
// Output: kozuscek
}