go1.20.5
GoThrough

utf16.AppendRune

// AppendRune appends the UTF-16 encoding of the Unicode code point r // to the end of p and returns the extended buffer. If the rune is not // a valid Unicode code point, it appends the encoding of U+FFFD. func AppendRune(a []uint16, r rune) []uint16

utf16.Decode

// Decode returns the Unicode code point sequence represented // by the UTF-16 encoding s. func Decode(s []uint16) []rune

utf16.DecodeRune

// DecodeRune returns the UTF-16 decoding of a surrogate pair. // If the pair is not a valid UTF-16 surrogate pair, DecodeRune returns // the Unicode replacement code point U+FFFD. func DecodeRune(r1 rune, r2 rune) rune

utf16.Encode

// Encode returns the UTF-16 encoding of the Unicode code point sequence s. func Encode(s []rune) []uint16

utf16.EncodeRune

// EncodeRune returns the UTF-16 surrogate pair r1, r2 for the given rune. // If the rune is not a valid Unicode code point or does not need encoding, // EncodeRune returns U+FFFD, U+FFFD. func EncodeRune(r rune) (r1 rune, r2 rune)

utf16.IsSurrogate

// IsSurrogate reports whether the specified Unicode code point // can appear in a surrogate pair. func IsSurrogate(r rune) bool