<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _encode_string(string):
 """Return a byte string, encoding Unicode with UTF-8."""

    if not isinstance(string, bytes):
        string = string.encode('utf8')
    return ffi.new('char[]', string)