Documentation ¶
Index ¶
- Constants
- func CloseQuietly(file *os.File)
- func CodecOf(charsetName string) (*encoding.Encoder, *encoding.Decoder, error)
- func Convert(src io.Reader, dest io.Writer, decoder *encoding.Decoder, ...) error
- func ConvertBetweenCharsets(src io.Reader, srcCharset string, dest io.Writer, destCharset string) error
- func ConvertFileBetweenCharsets(srcFilePath string, srcFileCharset string, destFilePath string, ...) error
- func CopyTmpFileTo(tmp *os.File, destPath string, destFlag int) error
- func Decode(src io.Reader, dest io.Writer, decoder *encoding.Decoder) error
- func DecodeBytes(src []byte, dest io.Writer, decoder *encoding.Decoder) error
- func DecodeBytesToBytes(src []byte, initBuffSize int, decoder *encoding.Decoder) ([]byte, error)
- func DecodeBytesToBytesWithCharset(src []byte, initBuffSize int, srcCharset string) ([]byte, error)
- func DecodeBytesToFile(src []byte, destFilePath string, destFileFlag int, decoder *encoding.Decoder) error
- func DecodeBytesToFileWithCharset(src []byte, destFilePath string, destFileFlag int, srcCharset string) error
- func DecodeBytesWithCharset(src []byte, dest io.Writer, srcCharset string) error
- func DecodeFile(srcFilePath string, dest io.Writer, decoder *encoding.Decoder) error
- func DecodeFileToFile(srcFilePath string, destFilePath string, destFileFlag int, ...) error
- func DecodeFileToFileWithCharset(srcFilePath string, destFilePath string, destFileFlag int, srcCharset string) error
- func DecodeFileWithCharset(srcFilePath string, dest io.Writer, srcCharset string) error
- func DecodeToBytes(src io.Reader, initBuffSize int, decoder *encoding.Decoder) ([]byte, error)
- func DecodeToBytesWithCharset(src io.Reader, initBuffSize int, srcCharset string) ([]byte, error)
- func DecodeToFile(src io.Reader, destFilePath string, destFileFlag int, ...) error
- func DecodeToFileWithCharset(src io.Reader, destFilePath string, destFileFlag int, srcCharset string) error
- func DecodeWithCharset(src io.Reader, dest io.Writer, srcCharset string) error
- func DecoderOf(charsetName string) *encoding.Decoder
- func Encode(src io.Reader, dest io.Writer, destEncoder *encoding.Encoder) error
- func EncodeFile(srcFilePath string, dest io.Writer, destEncoder *encoding.Encoder) error
- func EncodeFileToBytes(srcFilePath string, initBuffSize int, destEncoder *encoding.Encoder) ([]byte, error)
- func EncodeFileToBytesWithCharset(srcFilePath string, initBuffSize int, destCharset string) ([]byte, error)
- func EncodeFileToFile(srcFilePath string, destFilePath string, destFileFlag int, ...) error
- func EncodeFileToFileWithCharset(srcFilePath string, destFilePath string, destFileFlag int, destCharset string) error
- func EncodeFileWithCharset(srcFilePath string, dest io.Writer, destCharset string) error
- func EncodeString(src string, dest io.Writer, destEncoder *encoding.Encoder) error
- func EncodeStringToBytes(src string, initBuffSize int, destEncoder *encoding.Encoder) ([]byte, error)
- func EncodeStringToBytesWithCharset(src string, initBuffSize int, destCharset string) ([]byte, error)
- func EncodeStringWithCharset(src string, dest io.Writer, destCharset string) error
- func EncodeToBytes(src io.Reader, initBuffSize int, destEncoder *encoding.Encoder) ([]byte, error)
- func EncoderOf(charsetName string) *encoding.Encoder
- func EncodingOf(charsetName string) encoding.Encoding
- func GuessBest(data []byte) (result *chardet.Result, err error)
- func GuessBestOf(src io.Reader, bytesToDetect int) (result *chardet.Result, err error)
- func GuessBestOfFile(filePath string, bytesToDetect int) (*chardet.Result, error)
- func IsCharsetSupported(charset string) bool
- func MakeByteBuffer(initBufferSize int) *bytes.Buffer
- func MakeTempFile() (*os.File, error)
- func RemoveQuietly(file *os.File)
- type ErrUnsupportedCharset
- type ErrUnsupportedConversion
Constants ¶
View Source
const ( GBK = "GBK" GB18030 = "GB18030" Big5 = "Big5" )
中文
View Source
const ( EUCJP = "EUC-JP" ISO2022JP = "ISO-2022-JP" ShiftJIS = "Shift_JIS" )
日文
View Source
const ( UTF8 = "UTF-8" UTF16 = "UTF-16" UTF16BE = "UTF-16BE" UTF16LE = "UTF-16LE" )
Unicode
View Source
const ( Macintosh = "macintosh" IBM037 = "IBM037" IBM437 = "IBM437" IBM850 = "IBM850" IBM852 = "IBM852" IBM855 = "IBM855" IBM00858 = "IBM00858" IBM860 = "IBM860" IBM862 = "IBM862" IBM863 = "IBM863" IBM865 = "IBM865" IBM866 = "IBM866" IBM1047 = "IBM1047" IBM01140 = "IBM01140" ISO88591 = "ISO-8859-1" ISO88592 = "ISO-8859-2" ISO88593 = "ISO-8859-3" ISO88594 = "ISO-8859-4" ISO88595 = "ISO-8859-5" ISO88596 = "ISO-8859-6" ISO88596E = "ISO-8859-6-E" ISO88596I = "ISO-8859-6-I" ISO88597 = "ISO-8859-7" ISO88598 = "ISO-8859-8" ISO88598E = "ISO-8859-8-E" ISO88598I = "ISO-8859-8-I" ISO88599 = "ISO-8859-9" ISO885910 = "ISO-8859-10" ISO885913 = "ISO-8859-13" ISO885914 = "ISO-8859-14" ISO885915 = "ISO-8859-15" ISO885916 = "ISO-8859-16" KOI8R = "KOI8-R" KOI8U = "KOI8-U" Windows874 = "Windows-874" Windows1250 = "Windows-1250" Windows1251 = "Windows-1251" Windows1252 = "Windows-1252" Windows1253 = "Windows-1253" Windows1254 = "Windows-1254" Windows1255 = "Windows-1255" Windows1256 = "Windows-1256" Windows1257 = "Windows-1257" Windows1258 = "Windows-1258" )
其他字符集
View Source
const (
EUCKR = "EUC-KR"
)
Variables ¶
This section is empty.
Functions ¶
func CloseQuietly ¶ added in v0.1.0
func ConvertBetweenCharsets ¶ added in v0.1.0
func ConvertFileBetweenCharsets ¶ added in v0.1.0
func CopyTmpFileTo ¶ added in v0.1.0
func DecodeBytesToBytes ¶ added in v0.1.0
func DecodeBytesToBytesWithCharset ¶ added in v0.1.0
func DecodeBytesToFile ¶ added in v0.1.0
func DecodeBytesToFileWithCharset ¶ added in v0.1.0
func DecodeBytesWithCharset ¶ added in v0.1.0
func DecodeFile ¶ added in v0.1.0
func DecodeFileToFile ¶ added in v0.1.0
func DecodeFileToFileWithCharset ¶ added in v0.1.0
func DecodeFileWithCharset ¶ added in v0.1.0
func DecodeToBytes ¶ added in v0.1.0
func DecodeToBytesWithCharset ¶ added in v0.1.0
func DecodeToFile ¶ added in v0.0.3
func DecodeToFileWithCharset ¶ added in v0.1.0
func DecodeWithCharset ¶ added in v0.1.0
func EncodeFile ¶ added in v0.1.0
func EncodeFileToBytes ¶ added in v0.1.0
func EncodeFileToBytesWithCharset ¶ added in v0.1.0
func EncodeFileToFile ¶ added in v0.1.0
func EncodeFileToFileWithCharset ¶ added in v0.1.0
func EncodeFileWithCharset ¶ added in v0.1.0
func EncodeString ¶ added in v0.1.0
func EncodeStringToBytes ¶ added in v0.1.0
func EncodeStringToBytesWithCharset ¶ added in v0.1.0
func EncodeStringWithCharset ¶ added in v0.1.0
func EncodeToBytes ¶ added in v0.1.0
func EncodingOf ¶
EncodingOf 获取charsetName对应Encoding对象
func GuessBestOf ¶
GuessBestOf 通过前bytesToDetect个字节,猜测src编码,返回最接近的结果
func GuessBestOfFile ¶
GuessBestOfFile 通过前bytesToDetect个字节猜测文件编码,返回最接近的结果
func IsCharsetSupported ¶ added in v0.1.0
IsCharsetSupported 判断字符集是受支持
func MakeByteBuffer ¶ added in v0.1.0
func MakeTempFile ¶ added in v0.1.0
func RemoveQuietly ¶ added in v0.1.0
Types ¶
type ErrUnsupportedCharset ¶
type ErrUnsupportedCharset struct {
// contains filtered or unexported fields
}
func (ErrUnsupportedCharset) Error ¶
func (e ErrUnsupportedCharset) Error() string
type ErrUnsupportedConversion ¶
type ErrUnsupportedConversion struct {
// contains filtered or unexported fields
}
func (ErrUnsupportedConversion) Error ¶
func (e ErrUnsupportedConversion) Error() string
Click to show internal directories.
Click to hide internal directories.