bom

package module
v0.0.0-...-6386211 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2017 License: MIT Imports: 3 Imported by: 76

README

bom

small tools for cleaning bom from byte array or reader

Installation

$ go get github.com/ssor/bom

How to Use

	bs := []byte{bom0, bom1, bom2, 0x11}
	result := CleanBom(bs)
	bs := []byte{bom0, bom1, bom2, 0x11}
	result := NewReaderWithoutBom(bytes.NewReader(bs))

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanBom

func CleanBom(b []byte) []byte

CleanBom returns b with the 3 byte BOM stripped off the front if it is present. If the BOM is not present, then b is returned.

func NewReaderWithoutBom

func NewReaderWithoutBom(r io.Reader) (io.Reader, error)

NewReaderWithoutBom returns an io.Reader that will skip over initial UTF-8 byte order marks.

Types

This section is empty.

Jump to

Keyboard shortcuts

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