encoding

package
v1.15.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2020 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder = encoding.Decoder

func NewDecoder

func NewDecoder(enc string) (*Decoder, error)

NewDecoder returns a x/text Decoder for the specified text encoding. The Decoder converts a character encoding into utf-8 bytes. If a BOM is found it will be converted into a utf-8 BOM, you can use github.com/dimchansky/utfbom to strip the BOM.

The "none" or "" encoding will pass through bytes unchecked. Use the utf-8 encoding if you want invalid bytes replaced using the the unicode replacement character.

Detection of utf-16 endianness using the BOM is not currently provided due to the tail input plugins requirement to be able to start at the middle or end of the file.

Jump to

Keyboard shortcuts

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