Skip to content

Commit 6e6d34c

Browse files
committedJan 31, 2025·
fix: fix unicode encoding for json (#3880)
1 parent 9e5d263 commit 6e6d34c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎internal/apijson/encoder.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func (e *encoder) newPrimitiveTypeEncoder(t reflect.Type) encoderFunc {
143143
// code more and this current code shouldn't cause any issues
144144
case reflect.String:
145145
return func(v reflect.Value) ([]byte, error) {
146-
return []byte(fmt.Sprintf("%q", v.String())), nil
146+
return json.Marshal(v.Interface())
147147
}
148148
case reflect.Bool:
149149
return func(v reflect.Value) ([]byte, error) {

0 commit comments

Comments
 (0)
Please sign in to comment.