Versions in this module Expand all Collapse all v1 v1.0.0 Aug 23, 2023 v0 v0.1.0 Aug 23, 2023 Changes in this version + const CharsetARMSCII8 + const CharsetASCII + const CharsetBig5 + const CharsetBin + const CharsetCP1250 + const CharsetCP1251 + const CharsetCP1256 + const CharsetCP1257 + const CharsetCP850 + const CharsetCP852 + const CharsetCP866 + const CharsetCP932 + const CharsetDEC8 + const CharsetEUCJPMS + const CharsetEUCKR + const CharsetGB18030 + const CharsetGB2312 + const CharsetGBK + const CharsetGEOSTD8 + const CharsetGreek + const CharsetHP8 + const CharsetHebrew + const CharsetKEYBCS2 + const CharsetKOI8R + const CharsetKOI8U + const CharsetLatin1 + const CharsetLatin2 + const CharsetLatin5 + const CharsetLatin7 + const CharsetMacCE + const CharsetMacRoman + const CharsetSJIS + const CharsetSWE7 + const CharsetTIS620 + const CharsetUCS2 + const CharsetUJIS + const CharsetUTF16 + const CharsetUTF16LE + const CharsetUTF32 + const CharsetUTF8 + const CharsetUTF8MB4 + const CollationASCII + const CollationBin + const CollationGBKBin + const CollationGBKChineseCI + const CollationLatin1 + const CollationUTF8 + const CollationUTF8MB4 + const OpDecode + const OpDecodeNoErr + const OpDecodeReplace + const OpEncode + const OpEncodeNoErr + const OpEncodeReplace + const OpReplace + const OpReplaceNoErr + var CharacterSetInfos = map[string]*Charset + var EncodingASCIIImpl = &encodingASCII + var EncodingBinImpl = &encodingBin + var EncodingGBKImpl = &encodingGBK + var EncodingLatin1Impl = &encodingLatin1 + var EncodingUTF8Impl = &encodingUTF8 + var EncodingUTF8MB3StrictImpl = &encodingUTF8MB3Strict + var ErrCollationCharsetMismatch = terror.ClassDDL.NewStd(mysql.ErrCollationCharsetMismatch) + var ErrInvalidCharacterString = terror.ClassParser.NewStd(mysql.ErrInvalidCharacterString) + var ErrUnknownCollation = terror.ClassDDL.NewStd(mysql.ErrUnknownCollation) + var GBKCase = unicode.SpecialCase + var TiFlashSupportedCharsets = map[string]struct + func AddCharset(c *Charset) + func AddCollation(c *Collation) + func AddSupportedCollation(c *Collation) + func CountValidBytes(e Encoding, src []byte) int + func CountValidBytesDecode(e Encoding, src []byte) int + func GetCharsetInfoByID(coID int) (charsetStr string, collateStr string, err error) + func GetDefaultCharsetAndCollate() (defaultCharset string, defaultCollationName string) + func GetDefaultCollation(charset string) (string, error) + func GetDefaultCollationLegacy(charset string) (string, error) + func HackSlice(s string) (b []byte) + func HackString(b []byte) (s string) + func IsSupportedEncoding(charset string) bool + func Lookup(label string) (e encoding.Encoding, name string) + func NewCustomGBKEncoder() *encoding.Encoder + func RemoveCharset(c string) + func ValidCharsetAndCollation(cs string, co string) bool + type Charset struct + Collations map[string]*Collation + DefaultCollation string + Desc string + Maxlen int + Name string + func GetCharsetInfo(cs string) (*Charset, error) + func GetSupportedCharsets() []*Charset + type Collation struct + CharsetName string + ID int + IsDefault bool + Name string + func GetCollationByID(id int) (*Collation, error) + func GetCollationByName(name string) (*Collation, error) + func GetCollations() []*Collation + func GetSupportedCollations() []*Collation + type Encoding interface + Foreach func(src []byte, op Op, fn func(from, to []byte, ok bool) bool) + IsValid func(src []byte) bool + MbLen func(string) int + Name func() string + Peek func(src []byte) []byte + ToLower func(src string) string + ToUpper func(src string) string + Tp func() EncodingTp + Transform func(dest *bytes.Buffer, src []byte, op Op) ([]byte, error) + func FindEncoding(charset string) Encoding + func FindEncodingTakeUTF8AsNoop(charset string) Encoding + type EncodingTp int8 + const EncodingTpASCII + const EncodingTpBin + const EncodingTpGBK + const EncodingTpLatin1 + const EncodingTpNone + const EncodingTpUTF8 + const EncodingTpUTF8MB3Strict + type Op int16