Open veqryn opened 6 years ago
gojay should support SetEscapeHTML on the Encoder, and should default to true to match the standard library.
true
For example:
type Stuff struct { Thing string } v := &Stuff{Thing: `hello <&,.='"'=.,&> world`} buffer := &bytes.Buffer{} encoder := gojay.NewEncoder(buffer) encoder.SetEscapeHTML(false) _ = encoder.Encode(v)
Should result in: {"Thing":"hello <&,.='\"'=.,&> world"}
{"Thing":"hello <&,.='\"'=.,&> world"}
While encoder.SetEscapeHTML(true) should result in: {"Thing":"hello \u003c\u0026,.='\"'=.,\u0026\u003e world"} This should also be the default result when using gojay.Marshal
encoder.SetEscapeHTML(true)
{"Thing":"hello \u003c\u0026,.='\"'=.,\u0026\u003e world"}
gojay.Marshal
gojay should support SetEscapeHTML on the Encoder, and should default to
true
to match the standard library.For example:
Should result in:
{"Thing":"hello <&,.='\"'=.,&> world"}
While
encoder.SetEscapeHTML(true)
should result in:{"Thing":"hello \u003c\u0026,.='\"'=.,\u0026\u003e world"}
This should also be the default result when usinggojay.Marshal