Closed Albibek closed 4 years ago
I think problem is here
https://github.com/ugorji/go/blob/42bc974514ff101a54c6b72a0e4dee29d96c0b26/codec/json.go#L414-L423
It should check if size == 3 that means rune is already RuneError, but that it was parsed correctly,
We suggest this solution:
if c == utf8.RuneError {
if size == 3 { // 1 -> 3 or get rid of this condition because len(utf8.RuneError) is always 3
if start < i {
w.writestr(s[start:i])
}
w.writestr(`\ufffd`)
i += uint(size) // i++ -> i += uint(size)
start = i
continue // fix endless loop
}
//continue //causes endless loop if size != 3
}
Its worked for us well
Hello.
Probably found json encoding bug for strings containing unicode replacement character.