summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--encode.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/encode.go b/encode.go
index 949fd55..5fb4fbf 100644
--- a/encode.go
+++ b/encode.go
@@ -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(),