internal/unicode/cesu8/cesu8.go
func EncodeRune(p []byte, r rune) int {
	if r <= rune3Max {
		return encodeRune(p, r)
	}
	high, low := utf16.EncodeRune(r)
	n := encodeRune(p, high)
	n += encodeRune(p[n:], low)
	return n
}
func EncodeRune(p []byte, r rune) int {
	if r <= rune3Max {
		return encodeRune(p, r)
	}
	high, low := utf16.EncodeRune(r)
	n := encodeRune(p, high)
	n += encodeRune(p[n:], low)
	return n
}
// EncodeRune writes into p (which must be large enough) the CESU-8 encoding of the rune. It returns the number of bytes written.