utffile

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2019 License: BSD-2-Clause Imports: 7 Imported by: 0

README

GoDoc Go Report Card

utffile - Transparently read plain UTF8, UTF8 with BOM, UTF16-LE with BOM or UTF16-BE with BOM

This is just a small helper library for handling files without caring (too much) about their encoding. For documentation please read the godoc.

Documentation

Overview

Package utffile provides two helper functions to transparently read files encoded as plain UTF8, UTF8 with BOM, UTF16-LE with BOM or UTF16-BE with BOM as if they were plain UTF8 files. All files without a BOM are treated as UTF8 - this package does not support other encodings such as latin-1!

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(name string) (io.Reader, error)

Open calls os.Open. If the file could be opened successfully, it is wrapped by Wrap and then returned.

func Wrap

func Wrap(r io.Reader) io.Reader

Wrap returns a reader that reads from the given reader and transforms the input into plain UTF8 as necessary. If the given reader was an io.ReadCloser, the returned reader also will be io.ReadCloser.

Types

This section is empty.

Jump to

Keyboard shortcuts

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