Go-language library to check for problematic Unicode code points.
This is based on the Unicode code-point subsets specified in RFC9839.
The package defines a Subset
type and exports three instances, named Scalars
,
XmlChars
, and Assignables
. It exports three functions:
func (sub *Subset) ValidRune(r rune) bool
func (sub *Subset) ValidString(s string) bool
func (sub *Subset) ValidUtf8(u []byte) bool
A typical call might look like:
if !rfc9839.Assignables.ValidRune(r) {
return t.Error("invalid rune")
}