-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
Description
What version of Go are you using (go version
)?
$ go version go version go1.14.2 linux/amd64
What did you expect to see?
module json
add a API for marshal string with unicode escape would be useful.
unicode escape
https://tools.ietf.org/html/rfc7159#section-7
package main
import (
"fmt"
"encoding/json"
)
type Object struct {
Name string
}
func main() {
obj := Object{Name:"哇呀呀"}
line, _ := json.MarshalUnicodeEscape(obj)
fmt.Println(string(line))
}
{"Name": "\u54c7\u5440\u5440"}
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.Feedback is required from experts, contributors, and/or the community before a change can be made.