Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion json.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ 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"]`
want = input
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\""]`)
Expand Down