Documentation ¶
Index ¶
- func CharsetFromContentType(contentType string) string
- func DecodeBytes(src []byte, chatset string) ([]byte, error)
- func DetectAndDecodeBytes(src []byte, html ...bool) ([]byte, error)
- func DetectAndOpenFile(filename string, charsets ...string) (io.ReadCloser, string, error)
- func DetectAndReadFile(filename string, charsets ...string) ([]byte, string, error)
- func DetectAndTransform(r io.Reader, html ...bool) (io.Reader, string, error)
- func DetectCharsetBytes(data []byte, html ...bool) (string, error)
- func DetectCharsetFile(filename string) (string, error)
- func DetectCharsetReader(r io.Reader, html ...bool) (io.Reader, string, error)
- func IsHTMLFile(filename string) bool
- func OpenFile(filename string, charset string) (io.ReadCloser, error)
- func ReadFile(filename string, charset string) ([]byte, error)
- func Transform(r io.Reader, charset string) (io.Reader, string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CharsetFromContentType ¶
func DecodeBytes ¶
DecodeBytes Converts the bytes with specified charset to UTF-8.
func DetectAndDecodeBytes ¶
DecodeBytes Detect the chatset of the bytes and convert it to UTF-8.
func DetectAndOpenFile ¶
DetectAndOpenFile use specified charsets to open file, return (transformed reader, encoding name, error). if charsets is not specified, or specified charset is unsupported, detect the charset of the file, and open a transformed ReadCloser. return (nil, "", err) if failed to open file, charset is unsupported or read error occurred.
func DetectAndReadFile ¶
DetectAndReadFile detect the charset of the file, and open a transformed ReadCloser
func DetectAndTransform ¶
DetectAndTransform Detect the chatset from the reader and transform the reader with the detected xcharset.
func DetectCharsetFile ¶
DetectCharsetFile detect file's charset
func DetectCharsetReader ¶
func IsHTMLFile ¶
func OpenFile ¶
func OpenFile(filename string, charset string) (io.ReadCloser, error)
OpenFile use specified charset to open file and return a transformed ReadCloser. return (nil, error) if failed to open file or charset is unsupported
Types ¶
This section is empty.