Documentation ¶
Index ¶
- func DetermineEncodingbyPeek(r *bufio.Reader, contentType string) (encoding.Encoding, error)
- func GbkToUtf8(b []byte) []byte
- func TransformCoding(rd io.Reader, contentType string) (*transform.Reader, error)
- func UTF8ToGBK(b []byte) []byte
- func UnicodeStrToUtf8(str string) string
- func UnicodeToUtf8(str []byte) []byte
- func Utf8ToGB18030(text string) string
- func Utf8ToGbk(text string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetermineEncodingbyPeek ¶
自动检测html编码,不会减少缓冲器的内容, 得到编码器后用transform.NewReader解码为utf-8
func TransformCoding ¶
转码utf-8,contentType 可以传空值"" DetermineEncoding determines the encoding of an HTML document by examining up to the first 1024 bytes of content and the declared Content-Type.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.