diff options
-rw-r--r-- | encode.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -116,7 +116,7 @@ func encode(w internal.AllWriter, val reflect.Value, escaper BackslashEscaper, q return discardInt(w.WriteString("null")) } // Use a sub-ReEncoder to check that it's a full element. - validator := &ReEncoder{out: w, ReEncoderConfig: ReEncoderConfig{BackslashEscape: escaper}} + validator := &ReEncoder{out: w, ReEncoderConfig: ReEncoderConfig{BackslashEscape: EscapePreserve}} if err := obj.EncodeJSON(validator); err != nil { return &EncodeMethodError{ Type: val.Type(), @@ -152,7 +152,7 @@ func encode(w internal.AllWriter, val reflect.Value, escaper BackslashEscaper, q } } // Use a sub-ReEncoder to check that it's a full element. - validator := &ReEncoder{out: w, ReEncoderConfig: ReEncoderConfig{BackslashEscape: escaper}} + validator := &ReEncoder{out: w, ReEncoderConfig: ReEncoderConfig{BackslashEscape: EscapePreserve}} if _, err := validator.Write(dat); err != nil { return &EncodeMethodError{ Type: val.Type(), |