Standard library / unicode/utf8

utf8.FullRune()

Reports whether input starts with a complete rune; invalid leading encoding counts as a full width-one error rune. Expected stdout: 'false true\n'.

Formal Syntax & Structure

go syntaxgo
func FullRune(p []byte) bool

Parameters & Attributes

NameTypeDescription
p[]byteByte sequence or destination buffer, as specified.

Return Value

bool

Reports whether input starts with a complete rune; invalid leading encoding counts as a full width-one error rune.

Working Example

Example Snippetgo
package main
import (  "fmt"  "unicode/utf8")
func main() {  fmt.Println(utf8.FullRune([]byte{0xc3}), utf8.FullRune([]byte{0xff}))}
Go Reference