From 8cf4f32734bc154dc7153af89542dce2d294520c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 1 Feb 2025 03:54:59 +0000 Subject: [PATCH] fix: fix unicode encoding for json (#76) --- internal/apijson/encoder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/apijson/encoder.go b/internal/apijson/encoder.go index 8a693a7..f86bddb 100644 --- a/internal/apijson/encoder.go +++ b/internal/apijson/encoder.go @@ -143,7 +143,7 @@ func (e *encoder) newPrimitiveTypeEncoder(t reflect.Type) encoderFunc { // code more and this current code shouldn't cause any issues case reflect.String: return func(v reflect.Value) ([]byte, error) { - return []byte(fmt.Sprintf("%q", v.String())), nil + return json.Marshal(v.Interface()) } case reflect.Bool: return func(v reflect.Value) ([]byte, error) {