processingutils

package
v0.0.88 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeNonUTF8Bytes added in v0.0.76

func DecodeNonUTF8Bytes(data []byte) []byte

func DecodeNonUTF8String added in v0.0.70

func DecodeNonUTF8String(data string) string

func ReplaceLineTerminator added in v0.0.40

func ReplaceLineTerminator(data, newLineTerminator []byte) ([]byte, error)

ReplaceLineTerminator is delegated to find the line terminator of the given byte array and replace them without the one provided in input

func ReplaceLineTerminatorBytesReader added in v0.0.41

func ReplaceLineTerminatorBytesReader(data *bytes.Reader, newLineTerminator []byte) ([]byte, error)

ReplaceLineTerminatorBytesReader is delegated to find the line terminator of the given byte array and replace them without the one provided in input

func ToUTF8 added in v0.0.76

func ToUTF8(data []byte) ([]byte, error)

Types

type LineTerminatorType

type LineTerminatorType string
const (
	LF   LineTerminatorType = "\n"   // 0a -- 10
	CR   LineTerminatorType = "\r"   // 0d -- 13
	CRLF LineTerminatorType = "\r\n" // 0d,0a -- 13,10
	LFCR LineTerminatorType = "\n\r" // 0a,0d -- 10,13
	RS   LineTerminatorType = "\036" // 1e -- 30
	ND   LineTerminatorType = `unable to detect line terminator`
)

func DetectLineTerminator

func DetectLineTerminator(reader io.Reader) (LineTerminatorType, error)

Jump to

Keyboard shortcuts

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