From 5dd581bf6b8f6eb962ea825b4e6bb763378e6cc4 Mon Sep 17 00:00:00 2001 From: Devon Hudson Date: Mon, 11 Dec 2023 17:07:20 -0700 Subject: [PATCH] Convert unicode escapse to lowercase --- json.go | 2 +- json_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/json.go b/json.go index 91c45b82..274a89a8 100644 --- a/json.go +++ b/json.go @@ -309,7 +309,7 @@ func compactUnicodeEscape(input, output []byte, index int) ([]byte, int) { } const ( ESCAPES = "uuuuuuuubtnufruuuuuuuuuuuuuuuuuu" - HEX = "0123456789ABCDEF" + HEX = "0123456789abcdef" ) // If there aren't enough bytes to decode the hex escape then return. if len(input)-index < 4 { diff --git a/json_test.go b/json_test.go index 8c27802e..74be24dc 100644 --- a/json_test.go +++ b/json_test.go @@ -92,7 +92,7 @@ func TestCompactJSON(t *testing.T) { testCompactJSON(t, input, want) input = `["\u0008\u0009\u000A\u000B\u000C\u000D\u000E\u000F"]` - want = `["\b\t\n\u000B\f\r\u000E\u000F"]` + want = `["\b\t\n\u000b\f\r\u000e\u000f"]` testCompactJSON(t, input, want) input = `["\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017"]` @@ -100,7 +100,7 @@ func TestCompactJSON(t *testing.T) { testCompactJSON(t, input, want) input = `["\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F"]` - want = input + want = `["\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f"]` testCompactJSON(t, input, want) testCompactJSON(t, `["\u0061\u005C\u0042\u0022"]`, `["a\\B\""]`)