internal/unicode/cesu8/cesu8.go
func DecodeRune(p []byte) (rune, int) {
	high, n1, _ := decodeRune(p)
	if !utf16.IsSurrogate(high) {
		return high, n1
	}
	low, n2, _ := decodeRune(p[n1:])
	if low == utf8.RuneError {
		return low, n1 + n2
	}
	return utf16.DecodeRune(high, low), n1 + n2
}
func DecodeRune(p []byte) (rune, int) {
	high, n1, _ := decodeRune(p)
	if !utf16.IsSurrogate(high) {
		return high, n1
	}
	low, n2, _ := decodeRune(p[n1:])
	if low == utf8.RuneError {
		return low, n1 + n2
	}
	return utf16.DecodeRune(high, low), n1 + n2
}
func DecodeRune ( p [ ] byte ) ( rune , int ) { high , n1 , _ := decodeRune ( p ) if ! utf16 . IsSurrogate ( high ) { return high , n1 } low , n2 , _ := decodeRune ( p [ n1 : ] ) if low == utf8 . RuneError { return low , n1 + n2 } return utf16 . DecodeRune ( high , low ) , n1 + n2 }
// DecodeRune unpacks the first CESU-8 encoding in p and returns the rune and its width in bytes.
DecodeRune unpacks the first CESU - 8 encoding in p and returns the rune and its width in bytes .