def toUtf8(value):
return six.text_type(value).encode('<STR_LIT:utf-8>')<EOL>
Takes in a value and converts it to a text (unicode) type.  Then decodes that
type to a byte array encoded in utf-8.  In 2.X the resulting object will be a
str and in 3.X the resulting object will be bytes.  In both 2.X and 3.X any
object can be passed in and the object's __str__ will be used (or __repr__ if
__str__ is not defined) if the object is not already a text type.