Files
smpp-tester/encoding/ascii.go
2024-07-31 13:14:37 +02:00

16 lines
357 B
Go

package encoding
import "bytes"
type ASCIICoder struct{}
func (c *ASCIICoder) Encode(s *string, buf *bytes.Buffer) error {
// These should be ASCII but UTF8 is a superset of ASCII so hopefully this'll be fine
buf.WriteString(*s)
return nil
}
func (c *ASCIICoder) Decode(buf *bytes.Buffer) (string, error) {
return buf.String(), nil
}