Documentation ¶
Index ¶
- Variables
- func DetectEncoding(content []byte) (string, error)
- func RemoveBOMIfPresent(content []byte) []byte
- func ToUTF8(content string) string
- func ToUTF8DropErrors(content []byte) []byte
- func ToUTF8WithErr(content []byte) (string, error)
- func ToUTF8WithFallback(content []byte) []byte
- func ToUTF8WithFallbackReader(rd io.Reader) io.Reader
Constants ¶
This section is empty.
Variables ¶
View Source
var UTF8BOM = []byte{'\xef', '\xbb', '\xbf'}
UTF8BOM is the utf-8 byte-order marker
Functions ¶
func DetectEncoding ¶
DetectEncoding detect the encoding of content
func RemoveBOMIfPresent ¶
RemoveBOMIfPresent removes a UTF-8 BOM from a []byte
func ToUTF8DropErrors ¶
ToUTF8DropErrors makes sure the return string is valid utf-8; attempts conversion if possible
func ToUTF8WithErr ¶
ToUTF8WithErr converts content to UTF8 encoding
func ToUTF8WithFallback ¶
ToUTF8WithFallback detects the encoding of content and coverts to UTF-8 if possible
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.