Skip to content

Repository files navigation

unidecode

Go ReferenceTests

Unicode transliterator in Golang - Replaces non-ASCII characters with their ASCII approximations.

Fork of https://github.com/rainycape/unidecode

Example

package main
import (
"fmt""github.com/gosimple/unidecode"
)
funcmain() {
decoded:=unidecode.Unidecode("Łódź")
fmt.Println(decoded)
// Output: Lodz
}

Requests or bugs?

https://github.com/gosimple/unidecode/issues

Installation

go get -u github.com/gosimple/unidecode

Benchmark

go test -run=NONE -bench=. -benchmem -count=6 ./... > old.txt
# make changes
go test -run=NONE -bench=. -benchmem -count=6 ./... > new.txt
go install golang.org/x/perf/cmd/benchstat@latest
benchstat old.txt new.txt

Add new characters

  1. Edit table.txt file.

  2. Rebuild table.go file:

    gorun ./make_table.go

About

Unicode transliterator in Golang - Replaces non-ASCII characters with their ASCII approximations.

Resources

Code of conduct

Contributing

Stars

20 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages