From c352e8fb182b75605fbc618eef91d91bfa154bca Mon Sep 17 00:00:00 2001 From: lizixing Date: Thu, 9 May 2024 09:28:44 +0800 Subject: [PATCH] fix: fix a bug for escaping 0xE2 0x80 0xA8 in compactString (#479) --- internal/encoder/compact.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/encoder/compact.go b/internal/encoder/compact.go index 0eb9545..e287a6c 100644 --- a/internal/encoder/compact.go +++ b/internal/encoder/compact.go @@ -213,8 +213,8 @@ func compactString(dst, src []byte, cursor int64, escape bool) ([]byte, int64, e dst = append(dst, src[start:cursor]...) dst = append(dst, `\u202`...) dst = append(dst, hex[src[cursor+2]&0xF]) - cursor += 2 start = cursor + 3 + cursor += 2 } } switch c {