Documentation ¶
Index ¶
- func Decode(s []byte, enc string) (string, error)
- func DecodeBytes(s []byte, enc string) (string, error)
- func DecodeReader(s io.Reader, enc string) (string, error)
- func DecodeReaderBytes(s io.Reader, enc string) ([]byte, error)
- func DecodeString(s, enc string) (string, error)
- func Encode(s string, enc string) ([]byte, error)
- func EncodeBytes(s []byte, enc string) ([]byte, error)
- func EncodeReader(s io.Reader, enc string) ([]byte, error)
- func EncodeString(s, enc string) ([]byte, error)
- func MustDecode(s []byte, enc string) string
- func MustDecodeBytes(s []byte, enc string) []byte
- func MustDecodeReader(s io.Reader, enc string) string
- func MustDecodeString(s, enc string) string
- func MustEncode(s string, enc string) []byte
- func MustEncodeBytes(s []byte, enc string) []byte
- func MustEncodeReader(s io.Reader, enc string) []byte
- func MustEncodeString(s, enc string) []byte
- type CharsetGuess
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeBytes ¶
DecodeBytes converts given bytes to a UTF-8 string
func DecodeReader ¶
DecodeReader converts given Reader to a UTF-8 string
func DecodeString ¶
DecodeString converts given string to a UTF-8 string
func EncodeBytes ¶
EncodeBytes converts bytes to bytes encoded with given encoding
func EncodeReader ¶
EncodeReader converts a Reader to bytes encoded with given encoding
func EncodeString ¶
EncodeString converts a string to bytes encoded with given encoding
func MustDecode ¶
MustDecodeBytes converts given bytes to a UTF-8 string and panics if errros occur.
func MustDecodeBytes ¶
MustDecodeBytes converts given bytes to a UTF-8 string and panics if errros occur.
func MustDecodeReader ¶
MustDecodeReader converts given Reader to a UTF-8 string and panics if errros occur.
func MustDecodeString ¶
MustDecodeString converts given string to a UTF-8 string and panics if errros occur.
func MustEncode ¶
MustEncode converts a bytes to bytes encoded with given encoding and panics if errors occur
func MustEncodeBytes ¶
MustEncodeBytes converts a bytes to bytes encoded with given encoding and panics if errors occur
func MustEncodeReader ¶
MustEncodeReader converts a Reader to bytes encoded with given encoding and panics if errors occur
func MustEncodeString ¶
MustEncodeString converts a bytes to bytes encoded with given encoding and panics if errors occur
Types ¶
type CharsetGuess ¶
type CharsetGuess interface { // Charset returns a guessed charcter set Charset() string // Language returns a guessed language Language() string // Confidence returns a confidence of this guess Confidence() int }
CharsetGuess is a guessd charcter set
func Guess ¶
func Guess(s []byte) (CharsetGuess, error)
Guess guesses a character set of given bytes
func GuessBytes ¶
func GuessBytes(s []byte) (CharsetGuess, error)
GuessBytes guesses a character set of given bytes
func GuessReader ¶
func GuessReader(s io.Reader) (CharsetGuess, error)
GuessBytes guesses a character set of given Reader
func GuessString ¶
func GuessString(s string) (CharsetGuess, error)
GuessBytes guesses a character set of given string