Go 语言官方没有提供处理 utf8、unicode 之外字符编码的包。这样转换就需要用第三方包,候选包:
https://github.com/xushiwei/go-iconv
https://github.com/djimenez/iconv-go
https://github.com/sloonz/go-iconv
以上都是需要调用c库的,linux下面很容易编译过去,若是没有c编译经验很难在windows上编译过去。
下面提供一个纯go的吧
Go 语言官方没有提供处理 utf8、unicode 之外字符编码的包。这样转换就需要用第三方包,候选包:
https://github.com/xushiwei/go-iconv
https://github.com/djimenez/iconv-go
https://github.com/sloonz/go-iconv
以上都是需要调用c库的,linux下面很容易编译过去,若是没有c编译经验很难在windows上编译过去。
下面提供一个纯go的吧
转载于:https://my.oschina.net/deanzhao/blog/165253