桃花心木
Go中实现的字符集转换库。
Mahonia是在Go中实现的字符集转换库。 所有数据都被编译到可执行文件中; 它不需要任何外部数据文件。
从复制
安装
去获取github.com/henrylee2cn/mahonia
例子
package main
import "fmt"
import "github.com/henrylee2cn/mahonia"
func main(){
enc:=mahonia.NewEncoder("gbk")
//converts a string from UTF-8 to gbk encoding.
fmt.Println(enc.ConvertString("hello,世界"))
}
评论0
最新资源