https://github.com/timbray/rfc9839
Go-language library to check for problematic Unicode code points
https://github.com/timbray/rfc9839
Last synced: 10 months ago
JSON representation
Go-language library to check for problematic Unicode code points
- Host: GitHub
- URL: https://github.com/timbray/rfc9839
- Owner: timbray
- License: gpl-3.0
- Created: 2025-05-28T17:43:48.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-08-27T00:22:12.000Z (11 months ago)
- Last Synced: 2025-08-27T07:10:18.865Z (10 months ago)
- Language: Go
- Size: 29.3 KB
- Stars: 24
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RFC9839
[](https://github.com/timbray/RFC9839/actions/workflows/go-unit-tests.yaml)
[](https://codecov.io/gh/timbray/RFC9839)
[](https://0dependencies.dev)
Go-language library to check for problematic Unicode code points.
This is based on the Unicode code-point subsets specified in [RFC9839](https://www.rfc-editor.org/rfc/rfc9839.html).
The package defines a `Subset` type and exports three instances, named `Scalars`,
`XmlChars`, and `Assignables`. It exports three functions:
```go
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:
```go
if !rfc9839.Assignables.ValidRune(r) {
return t.Error("invalid rune")
}
```