kubernetes/vendor/golang.org/x/text/encoding/encoding.go

type Encoding

type Decoder

// Bytes converts the given encoded bytes to UTF-8. It returns the converted
// bytes or nil, err if any error occurred.
func (d *Decoder) Bytes(b []byte) ([]byte, error) {}

// String converts the given encoded string to UTF-8. It returns the converted
// string or "", err if any error occurred.
func (d *Decoder) String(s string) (string, error) {}

// Reader wraps another Reader to decode its bytes.
//
// The Decoder may not be used for any other operation as long as the returned
// Reader is in use.
func (d *Decoder) Reader(r io.Reader) io.Reader {}

type Encoder

// Bytes converts bytes from UTF-8. It returns the converted bytes or nil, err if
// any error occurred.
func (e *Encoder) Bytes(b []byte) ([]byte, error) {}

// String converts a string from UTF-8. It returns the converted string or
// "", err if any error occurred.
func (e *Encoder) String(s string) (string, error) {}

// Writer wraps another Writer to encode its UTF-8 output.
//
// The Encoder may not be used for any other operation as long as the returned
// Writer is in use.
func (e *Encoder) Writer(w io.Writer) io.Writer {}

const ASCIISub

var Nop

type nop

func (nop) NewDecoder() *Decoder {}

func (nop) NewEncoder() *Encoder {}

var Replacement

type replacement

func (replacement) NewDecoder() *Decoder {}

func (replacement) NewEncoder() *Encoder {}

func (replacement) ID() (mib identifier.MIB, other string) {}

type replacementDecoder

func (replacementDecoder) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) {}

type replacementEncoder

func (replacementEncoder) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) {}

// HTMLEscapeUnsupported wraps encoders to replace source runes outside the
// repertoire of the destination encoding with HTML escape sequences.
//
// This wrapper exists to comply to URL and HTML forms requiring a
// non-terminating legacy encoder. The produced sequences may lead to data
// loss as they are indistinguishable from legitimate input. To avoid this
// issue, use UTF-8 encodings whenever possible.
func HTMLEscapeUnsupported(e *Encoder) *Encoder {}

// ReplaceUnsupported wraps encoders to replace source runes outside the
// repertoire of the destination encoding with an encoding-specific
// replacement.
//
// This wrapper is only provided for backwards compatibility and legacy
// handling. Its use is strongly discouraged. Use UTF-8 whenever possible.
func ReplaceUnsupported(e *Encoder) *Encoder {}

type errorHandler

type repertoireError

func (h errorHandler) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) {}

func errorToHTML(dst []byte, r rune, err repertoireError) (n int, ok bool) {}

func errorToReplacement(dst []byte, r rune, err repertoireError) (n int, ok bool) {}

var ErrInvalidUTF8

var UTF8Validator

type utf8Validator

func (utf8Validator) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) {}