MCPcopy Create free account
hub / github.com/apecloud/myduckserver / EncodeBytes

Function EncodeBytes

charset/charset.go:95–103  ·  view source on GitHub ↗
(id sql.CharacterSetID, utf8 []byte)

Source from the content-addressed store, hash-verified

93}
94
95func EncodeBytes(id sql.CharacterSetID, utf8 []byte) ([]byte, error) {
96 en, err := getEncoding(id)
97 if err != nil {
98 return utf8, err
99 } else if en == encoding.Nop {
100 return utf8, nil
101 }
102 return en.NewEncoder().Bytes(utf8)
103}
104
105func DecodeBytes(id sql.CharacterSetID, encoded []byte) ([]byte, error) {
106 en, err := getEncoding(id)

Callers

nothing calls this directly

Calls 1

getEncodingFunction · 0.85

Tested by

no test coverage detected