in the func EncodeRune, it seems the code "|| IsSurrogate(r)" can be removed,
yes?
func EncodeRune(r rune) (r1, r2 rune) {
if r < surrSelf || r > maxRune || IsSurrogate(r) {
return replacementChar, replacementChar
}
r -= surrSelf
return surr1 + (r>>10)&0x3ff, surr2 + r&0x3ff
}
The text was updated successfully, but these errors were encountered:
by chanxuehong:
The text was updated successfully, but these errors were encountered: