text: golang.org/x/text/encoding/internal Index | Files | Directories

package internal

import "golang.org/x/text/encoding/internal"

Package internal contains code that is shared among encoding implementations.


Package Files



var ErrASCIIReplacement = RepertoireError(encoding.ASCIISub)

type Encoding Uses

type Encoding struct {
    Name string
    MIB  identifier.MIB

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

func (*Encoding) ID Uses

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

func (*Encoding) String Uses

func (e *Encoding) String() string

type FuncEncoding Uses

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

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

func (FuncEncoding) NewDecoder Uses

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

func (FuncEncoding) NewEncoder Uses

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

type RepertoireError Uses

type RepertoireError byte

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

func (RepertoireError) Error Uses

func (r RepertoireError) Error() string

Error implements the error interrface.

func (RepertoireError) Replacement Uses

func (r RepertoireError) Replacement() byte

Replacement returns the replacement string associated with this error.

type SimpleEncoding Uses

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

SimpleEncoding is an Encoding that combines two Transformers.

func (*SimpleEncoding) NewDecoder Uses

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

func (*SimpleEncoding) NewEncoder Uses

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


identifierPackage identifier defines the contract between implementations of Encoding and Index by defining identifiers that uniquely identify standardized coded character sets (CCS) and character encoding schemes (CES), which we will together refer to as encodings, for which Encoding implementations provide converters to and from UTF-8.

Package internal imports 3 packages (graph) and is imported by 8 packages. Updated 2020-12-08. Refresh now. Tools for package owners.