File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -334,7 +334,27 @@ func (n *lazyNode) equal(o *lazyNode) bool {
334334return false
335335}
336336
337- return bytes .Equal (n .compact (), o .compact ())
337+ nc := n .compact ()
338+ oc := o .compact ()
339+
340+ if nc [0 ] == '"' && oc [0 ] == '"' {
341+ // ok, 2 strings
342+
343+ var ns , os string
344+
345+ err := json .Unmarshal (nc , & ns )
346+ if err != nil {
347+ return false
348+ }
349+ err = json .Unmarshal (oc , & os )
350+ if err != nil {
351+ return false
352+ }
353+
354+ return ns == os
355+ }
356+
357+ return bytes .Equal (nc , oc )
338358}
339359}
340360
Original file line number Diff line number Diff line change @@ -1078,6 +1078,12 @@ var EqualityCases = []EqualityCase{
10781078`null` ,
10791079false ,
10801080},
1081+ {
1082+ "Unicode" ,
1083+ `{"name": "λJohn"}` ,
1084+ `{"name": "\u03BBJohn"}` ,
1085+ true ,
1086+ },
10811087}
10821088
10831089func TestEquality (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments