MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / PrintableBytes

Function PrintableBytes

pkg/util/encoding/encoding.go:2410–2412  ·  view source on GitHub ↗

PrintableBytes returns true iff the given byte array is a valid UTF-8 sequence and it is printable.

(b []byte)

Source from the content-addressed store, hash-verified

2408// PrintableBytes returns true iff the given byte array is a valid
2409// UTF-8 sequence and it is printable.
2410func PrintableBytes(b []byte) bool {
2411 return len(bytes.TrimLeftFunc(b, isValidAndPrintableRune)) == 0
2412}
2413
2414func isValidAndPrintableRune(r rune) bool {
2415 return r != utf8.RuneError && unicode.IsPrint(r)

Callers 1

PrettyPrintValueEncodedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…