Encode the provided string data using the encoding implemented by this encoder; by default, the string will be interpreted using UTF-8
encoding, then encoded to the target encoding.
Return
Encoded bytes of the provided string.
Parameters
String to encode with this encoder.