380 Star 2.5K Fork 620

GVPJohn / gf

 / 详情

gparser.LoadContent 报错

已完成
创建于  
2018-07-03 22:35

data :=

Tove
Jani
Reminder
Don't forget me this weekend!
`

if p, e := gparser.LoadContent([]byte(data), "xml"); e != nil {
	glog.Error(e)
} else {
	fmt.Println("Heading:", p.GetString("note.heading"))
}`

若xml头不包含encoding="UTF-8" ,gparser.LoadContent会报错
panic: runtime error: index out of range

评论 (3)

katydid酱 创建了任务

问题收到,感谢反馈

John 开始了任务

已修复,原因是gxml.ToJson报错引起的,修改当没有encoding时默认使用utf8编码

John 关闭了任务

非常感谢两位大佬

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(3)
1309327 johng 1705475649 1923122 wenzi1 1578962481
Go
1
https://gitee.com/johng/gf.git
git@gitee.com:johng/gf.git
johng
gf
gf

搜索帮助

344bd9b3 5694891 D2dac590 5694891