def utf8(value):
    if isinstance(value, _UTF8_TYPES):
        return value
    elif isinstance(value, unicode_type):
        return value.encode("utf-8")
    else:
        return str(value)
Converts a string argument to a byte string.
dataset/ETHPy150Open limodou/uliweb/uliweb/core/template.py/utf8