-
-
Notifications
You must be signed in to change notification settings - Fork 176
Closed
Description
package main
import (
"fmt"
"encoding/json"
gjson "github.com/goccy/go-json"
)
type obj struct {
Msg string `json:"消息"`
}
func main() {
// \u6D88\u606F are escaped charecters for Chinese word "消息"
b := []byte(`{"\u6D88\u606F":"\u6D88\u606F"}`)
o := obj{}
json.Unmarshal(b, &o)
fmt.Printf("got json object: %+v\n", o)
o = obj{}
gjson.Unmarshal(b, &o)
fmt.Printf("got gjson object: %+v\n", o)
}
Expected
go run /tmp/t.go
got json object: {Msg:消息}
got gjson object: {Msg:消息}
Actual
go run /tmp/t.go
got json object: {Msg:消息}
got gjson object: {Msg:}
Metadata
Metadata
Assignees
Labels
No labels