Encode a string to bytes.
Usage
encode(data)
data: str
The string to encode.
bytes
The encoded bytes.