Documentation
¶
Index ¶
- func Decode(data []byte, name string) (string, error)
- func DecodeReplace(data []byte, name string) (string, error)
- func Encode(text, name string) (string, error)
- func GetEncoding() string
- func InfoName(name string) (string, bool)
- func LocaleEncoding() string
- func Lookup(name string) (string, bool)
- type LookupError
- type UnicodeDecodeError
- type UnicodeEncodeError
- type UnicodeError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeReplace ¶
bytes.decode with errors replace, each undecodable byte becoming U+FFFD as the CPython codecs do
func GetEncoding ¶
func GetEncoding() string
locale.getencoding, the LC_CTYPE codeset whatever the UTF-8 mode, a C locale coerced only while LC_ALL is unset
func LocaleEncoding ¶
func LocaleEncoding() string
locale.getencoding after the PEP 538 coercion, the LC_CTYPE codeset or utf-8 for the C locale
Types ¶
type LookupError ¶
LookupError is the codecs.lookup failure for an unknown name, or a bytes codec refused by the NotText operation
func (*LookupError) Error ¶
func (e *LookupError) Error() string
type UnicodeDecodeError ¶
type UnicodeDecodeError struct {
Codec string
Byte byte
Pos int
Reason string
End int
Len int
// Positions past the int range a punycode error can carry, used instead of Pos and End when set
BigPos, BigEnd *big.Int
}
UnicodeDecodeError is the strict decode failure over bytes Pos to End of input Len long, End zero meaning one
func (*UnicodeDecodeError) Error ¶
func (e *UnicodeDecodeError) Error() string
type UnicodeEncodeError ¶
UnicodeEncodeError is the strict encode failure over characters Start to End, Len the text length when known
func (*UnicodeEncodeError) Error ¶
func (e *UnicodeEncodeError) Error() string
type UnicodeError ¶
type UnicodeError struct{ Msg string }
UnicodeError of a codec refusing an operation outright
func (*UnicodeError) Error ¶
func (e *UnicodeError) Error() string
func (*UnicodeError) PyTypeName ¶
func (e *UnicodeError) PyTypeName() string