Documentation ¶
Index ¶
- Constants
- func ContainSubsAny(str string, subs ...string) (result bool)
- func EncodeWithGBK(src string) (dst string, err error)
- func EncodeWithUTF8(src string) (dst string, err error)
- func GetRandomString(n int) string
- func GetStrCoding(data []byte) string
- func IsChinese(str string) bool
- func ParseInt64(b string, defInt int64) int64
- func StrToUInt64(str string) uint64
Constants ¶
View Source
const ( GBK string = "GBK" UTF8 string = "UTF8" UNKNOWN string = "UNKNOWN" )
Variables ¶
This section is empty.
Functions ¶
func ContainSubsAny ¶
func EncodeWithGBK ¶
EncodeWithGBK 目前只能把UTF8转为GBK,若字符串为GBK则原样输出
func EncodeWithUTF8 ¶
EncodeWithUTF8 目前只能把GBK转为UTF8,若字符串为UTF8则原样输出
func GetStrCoding ¶
需要说明的是,isGBK()是通过双字节是否落在gbk的编码范围内实现的, 而utf-8编码格式的每个字节都是落在gbk的编码范围内, 所以只有先调用isUtf8()先判断不是utf-8编码,再调用isGBK()才有意义
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.