Transliteration package for Go

773 views
Skip to first unread message

snore...@gmail.com

unread,
May 23, 2013, 10:48:22 AM5/23/13
to golan...@googlegroups.com
Hi,

I need to somehow convert non-latin names (cyrillic, chinese and japanese mainly) to the latin alphabet.
Is there a package for transliteration somewhere?

Dobrosław Żybort

unread,
May 24, 2013, 8:02:59 AM5/24/13
to golan...@googlegroups.com
Maybe Unidecode could help?:
> Unicode transliterator (also known as unidecode) for Go
Doc: http://godoc.org/github.com/fiam/gounidecode/unidecode
Src: https://github.com/fiam/gounidecode

Example usage

package main

import (
    "fmt"
    "github.com/fiam/gounidecode/unidecode"
)

func main() {
    fmt.Println(Unidecode("áéíóú")) // Will print aeiou
    fmt.Println(Unidecode("\u5317\u4EB0")) // Will print Bei Jing
    fmt.Println(Unidecode("Κνωσός")) // Will print Knosos
}

Best regards,
Dobrosław Żybort

snore...@gmail.com

unread,
May 24, 2013, 11:32:38 AM5/24/13
to golan...@googlegroups.com
Hello,

Exactly what I needed - thank you very much!
Reply all
Reply to author
Forward
0 new messages