characters

package
v2.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InvalidAscii

func InvalidAscii(b byte) bool

func Utf8TomlValidAlreadyEscaped

func Utf8TomlValidAlreadyEscaped(p []byte) (err utf8Err)

Verified that a given string is only made of valid UTF-8 characters allowed by the TOML spec:

Any Unicode character may be used except those that must be escaped: quotation mark, backslash, and the control characters other than tab (U+0000 to U+0008, U+000A to U+001F, U+007F).

It is a copy of the Go 1.17 utf8.Valid implementation, tweaked to exit early when a character is not allowed.

The returned utf8Err is Zero() if the string is valid, or contains the byte index and size of the invalid character.

quotation mark => already checked backslash => already checked 0-0x8 => invalid 0x9 => tab, ok 0xA - 0x1F => invalid 0x7F => invalid

func Utf8ValidNext

func Utf8ValidNext(p []byte) int

Return the size of the next rune if valid, 0 otherwise.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL