...

Package internal

import "golang.org/x/text/encoding/internal"
Overview
Index
Subdirectories

Overview ▾

Package internal contains code that is shared among encoding implementations.

Variables

var ErrASCIIReplacement = RepertoireError(encoding.ASCIISub)

type Encoding

Encoding is an implementation of the Encoding interface that adds the String and ID methods to an existing encoding.

type Encoding struct {
    encoding.Encoding
    Name string
    MIB  identifier.MIB
}

func (*Encoding) ID

func (e *Encoding) ID() (mib identifier.MIB, other string)

func (*Encoding) String

func (e *Encoding) String() string

type FuncEncoding

FuncEncoding is an Encoding that combines two functions returning a new Transformer.

type FuncEncoding struct {
    Decoder func() transform.Transformer
    Encoder func() transform.Transformer
}

func (FuncEncoding) NewDecoder

func (e FuncEncoding) NewDecoder() *encoding.Decoder

func (FuncEncoding) NewEncoder

func (e FuncEncoding) NewEncoder() *encoding.Encoder

type RepertoireError

A RepertoireError indicates a rune is not in the repertoire of a destination encoding. It is associated with an encoding-specific suggested replacement byte.

type RepertoireError byte

func (RepertoireError) Error

func (r RepertoireError) Error() string

Error implements the error interface.

func (RepertoireError) Replacement

func (r RepertoireError) Replacement() byte

Replacement returns the replacement string associated with this error.

type SimpleEncoding

SimpleEncoding is an Encoding that combines two Transformers.

type SimpleEncoding struct {
    Decoder transform.Transformer
    Encoder transform.Transformer
}

func (*SimpleEncoding) NewDecoder

func (e *SimpleEncoding) NewDecoder() *encoding.Decoder

func (*SimpleEncoding) NewEncoder

func (e *SimpleEncoding) NewEncoder() *encoding.Encoder

Subdirectories

Name Synopsis
..