Documentation ¶
Index ¶
- Variables
- func Decode(p []byte, enc encoding.Encoding) (string, error)
- func Encode(p string, enc encoding.Encoding) ([]byte, error)
- func GetEncoding(name string) encoding.Encoding
- func NewDecodingReader(r io.Reader, enc encoding.Encoding) io.Reader
- func NewEncodingWriter(w io.Writer, enc encoding.Encoding) io.WriteCloser
- func NewReader(r io.Reader, enc encoding.Encoding) io.Reader
- func NewStringReader(r io.Reader) io.Reader
- func NewWriter(w io.Writer, enc encoding.Encoding) io.WriteCloser
Constants ¶
This section is empty.
Variables ¶
var ISO8859_1 encoding.Encoding = cmap("ISO8859-1")
ISO8859_1 is the Encoding for ISO-8859-1
Functions ¶
func Decode ¶
Decode decodes the bytes from enc to utf8 (an allocating, convenience version of transform.Transform).
func Encode ¶
Encode encodes the bytes from utf8 to the given encoding (an allocating, convenience version of transform.Transform).
func GetEncoding ¶
GetEncoding returns the encoding.Encoding for the text name of the encoding Returns nil if the encoding is not found.
Knows the ISO8859 family, KOI8, Windows and Mac codepages, but misses other Asian codepages
func NewDecodingReader ¶
NewDecodingReader is a deprecated, it has been renamed to NewReader.
func NewEncodingWriter ¶
NewEncodingWriter is deprecated, has been renamed to NewWriter.
func NewReader ¶
NewReader returns a reader which decode from the given encoding, to utf8.
If enc is nil, then only an utf8-enforcing replacement reader (see http://godoc.org/code.google.com/p/go.text/encoding#pkg-variables) is used.
func NewStringReader ¶
NewStringReader wraps an io.Reader which reads UTF-8, and splits reads between valid runes, never inside a rune.
func NewWriter ¶
NewWriter returns a writer which encodes to the given encoding, utf8.
If enc is nil, then only an utf8-enforcing replacement writer (see http://godoc.org/code.google.com/p/go.text/encoding#pkg-variables) is used.
Types ¶
This section is empty.