1# unidecode
2
3[](https://pkg.go.dev/github.com/gosimple/unidecode)
4[](https://github.com/gosimple/unidecode/actions/workflows/tests.yml)
5
6Unicode transliterator in Golang - Replaces non-ASCII characters with their
7ASCII approximations.
8
9Fork of https://github.com/rainycape/unidecode
10
11## Example
12
13```go
14package main
15
16import (
17 "fmt"
18
19 "github.com/gosimple/unidecode"
20)
21
22func main() {
23 decoded := unidecode.Unidecode("Łódź")
24 fmt.Println(decoded)
25 // Output: Lodz
26}
27```
28
29### Requests or bugs?
30
31<https://github.com/gosimple/unidecode/issues>
32
33## Installation
34
35```shell
36go get -u github.com/gosimple/unidecode
37```
38
39## Benchmark
40
41```shell
42go test -run=NONE -bench=. -benchmem -count=6 ./... > old.txt
43# make changes
44go test -run=NONE -bench=. -benchmem -count=6 ./... > new.txt
45
46go install golang.org/x/perf/cmd/benchstat@latest
47
48benchstat old.txt new.txt
49```
50
51## Add new characters
52
531. Edit `table.txt` file.
542. Rebuild `table.go` file:
55
56 ```go
57 go run ./make_table.go
58 ```