Skip to content

Commit 580ffb2

Browse files
committed
Adding a unit test showing why decodeUTF8 is needed when unmarshalling JSON
1 parent 26d3515 commit 580ffb2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

json_test.go

+5
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,11 @@ func TestJSONRoundTrip(t *testing.T) {
290290
targetFactory: func() any { return &nestedMaps{} },
291291
isPrettyPrinted: true,
292292
},
293+
{
294+
name: "with UTF-8 special chars in key",
295+
input: `{"�":0}`,
296+
targetFactory: func() any { return &OrderedMap[string, int]{} },
297+
},
293298
} {
294299
t.Run(testCase.name, func(t *testing.T) {
295300
target := testCase.targetFactory()

0 commit comments

Comments
 (0)