1 Star 0 Fork 0

Stefan/xgameCommon

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
encoding.go 385 Bytes
一键复制 编辑 原始数据 按行查看 历史
Stefan 提交于 2020-05-09 19:48 +08:00 . add common file.
package utls
// add by stefan
import (
"github.com/axgle/mahonia"
)
func GBKToUTF8(src string) string {
return mahonia.NewDecoder("utf8").ConvertString(src)
}
func UTF8ToGBK(src string) string {
return mahonia.NewEncoder("gbk").ConvertString(src)
}
/*
for chinese encoding.
*/
func UTF8ToGB18030(src string) string {
return mahonia.NewDecoder("GB18030").ConvertString(src)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/stefan886/xgameCommon.git
git@gitee.com:stefan886/xgameCommon.git
stefan886
xgameCommon
xgameCommon
v0.0.5

搜索帮助