def METHOD_NAME(self, input, errors, final):
    if errors != 'strict':
        raise UnicodeError("Unsupported error handling "+errors)
    if not input:
        return (u"", 0)
    # IDNA allows decoding to operate on Unicode strings, too.
    if isinstance(input, unicode):
        labels = dots.split(input)
    else:
        # Must be ASCII string
        input = str(input)
        unicode(input, "ascii")
        labels = input.split(".")
    trailing_dot = u''
    if labels:
        if not labels[-1]:
            trailing_dot = u'.'
            del labels[-1]
        elif not final:
            # Keep potentially unfinished label until the next call
            del labels[-1]
            if labels:
                trailing_dot = u'.'
    result = []
    size = 0
    for label in labels:
        result.append(ToUnicode(label))
        if size:
            size += 1
        size += len(label)
    result = u".".join(result) + trailing_dot
    size += len(trailing_dot)
    return (result, size)