def ucd(input):
    """Convert a string or unicode object, to a unicode version."""
    # print(type(input), input)
    try:
        input = input.decode('utf-8')
    except AttributeError:
        pass
    return input