Source File
decode.go
Belonging Package
github.com/gosimple/unidecode
package unidecodeimport ()const (dummyLenght = byte(0xff))var (transliterations [65536][]runetransCount = rune(len(transliterations)))func decodeTransliterations() {, := zlib.NewReader(strings.NewReader(tableData))if != nil {panic()}defer .Close():= make([]byte, 0, 13) // 13 = longest transliteration, adjust if needed:= [:1]:= uint16(0xffff) // char counter, rely on overflow on first passfor {++if , := io.ReadFull(, ); != nil {if == io.EOF {break}panic()}if [0] == dummyLenght {continue}= [:[0]] // resize, preserving allocationif , := io.ReadFull(, ); != nil {panic()}transliterations[int()] = []rune(string())}}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |