gitee.com/quant1x/gox@v1.7.6/text/encoding/README.md (about) 1 mahonia 2 ======= 3 4 character-set conversion library implemented in Go. 5 6 Mahonia is a character-set conversion library implemented in Go. All data is compiled into the executable; it doesn't 7 need any external data files. 8 9 based on http://code.google.com/p/mahonia/ 10 11 install 12 ------- 13 14 go get github.com/axgle/mahonia 15 16 example 17 ------- 18 19 package main 20 import "fmt" 21 import "github.com/axgle/mahonia" 22 func main(){ 23 enc:=mahonia.NewEncoder("gbk") 24 //converts a string from UTF-8 to gbk encoding. 25 fmt.Println(enc.ConvertString("hello,世界")) 26 } 27 28 donate 29 ------- 30 https://github.com/axgle/mahonia/wiki/Donate