'Get a generator for files in the torrent def. No filtering
is possible and all tricks are allowed to obtain a unicode
list of filenames.
@return A unicode filename generator.'

def _get_all_files_as_unicode_with_length(self):

    assert self.metainfo_valid, 'TorrentDef    is    not    finalized'
    if ('files' in self.metainfo['info']):
        join = os.path.join
        files = self.metainfo['info']['files']
        for file_dict in files:
            if ('path.utf-8' in file_dict):
                try:
                    (yield (join(*[unicode(element, 'UTF-8') for element in file_dict['path.utf-8']]), file_dict['length']))
                    continue
                except UnicodeError:
                    pass
            if ('path' in file_dict):
                if ('encoding' in self.metainfo):
                    encoding = self.metainfo['encoding']
                    try:
                        (yield (join(*[unicode(element, encoding) for element in file_dict['path']]), file_dict['length']))
                        continue
                    except UnicodeError:
                        pass
                    except LookupError:
                        pass
                try:
                    (yield (join(*[unicode(element) for element in file_dict['path']]), file_dict['length']))
                    continue
                except UnicodeError:
                    pass
                try:
                    (yield (join(*[unicode(element, 'UTF-8') for element in file_dict['path']]), file_dict['length']))
                    continue
                except UnicodeError:
                    pass
                try:
                    def filter_characters(name):
                        def filter_character(char):
                            if (0 < ord(char) < 128):
                                return char
                            else:
                                self._logger.debug('Bad    character    filter    %s,    isalnum?    %s', ord(char), char.isalnum())
                                return u'?'
                        return u''.join([filter_character(char) for char in name])
                    (yield (join(*[unicode(filter_characters(element)) for element in file_dict['path']]), file_dict['length']))
                    continue
                except UnicodeError:
                    pass
    else:
        (yield (self.get_name_as_unicode(), self.metainfo['info']['length']))
