@classmethod<EOL><INDENT>def encode(cls, value):<DEDENT>
coerced = unicode(value)<EOL>if coerced == value:<EOL><INDENT>return coerced.encode(cls._encoding)<EOL><DEDENT>raise InvalidValue('<STR_LIT>')<EOL>
take a valid unicode string and turn it into utf-8 bytes

:param value: unicode, str
:return: bytes