def char2code(unicode):
    """Returns the ASCII code for a unicode character.

    Args:
        unicode (str):

    Raises:
        TypeError: string is length two.
    """
    try:
        code = 'U+{0:04x}'.format(ord(unicode))
    except TypeError:
        code = unicode
    return code
