textutils

package
v0.130.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UTF8Raw encoding.Encoding = utf8raw{}

UTF8Raw is a variant of the UTF-8 encoding without replacing invalid UTF-8 sequences. It behaves in the same way as encoding.Nop, but is differentiated from nop encoding, which we treat in a special way.

Functions

func DecodeAsString added in v0.120.0

func DecodeAsString(decoder *encoding.Decoder, buf []byte) (string, error)

DecodeAsString converts the given encoded bytes using the given decoder. It returns the converted bytes or nil, err if any error occurred.

func IsNop

func IsNop(enc string) bool

func LookupEncoding added in v0.120.0

func LookupEncoding(enc string) (encoding.Encoding, error)

func UnsafeBytesAsString added in v0.120.0

func UnsafeBytesAsString(buf []byte) string

UnsafeBytesAsString converts the byte array to string. This function must be called iff the input buffer is not going to be re-used after.

Types

This section is empty.

Jump to

Keyboard shortcuts

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