You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-06-15 22:50:24 +02:00
fix: invalid unicode while binary to string
This commit is contained in:
@ -180,9 +180,9 @@ func readHex(iter *jsoniter.Iterator, b1, b2 byte) byte {
|
||||
}
|
||||
ret *= 16
|
||||
if b2 >= '0' && b2 <= '9' {
|
||||
ret = b2 - '0'
|
||||
ret += b2 - '0'
|
||||
} else if b2 >= 'a' && b2 <= 'f' {
|
||||
ret = b2 - 'a' + 10
|
||||
ret += b2 - 'a' + 10
|
||||
} else {
|
||||
iter.ReportError("read hex", "expects 0~9 or a~f, but found "+string([]byte{b2}))
|
||||
return 0
|
||||
|
Reference in New Issue
Block a user