def output_file_name(channel):
    """Build name of output file for a given channel."""
    def as_string(sequence):
        if isinstance(sequence, str):
            return sequence
        return sequence.decode('UTF-8')

    components = '.'.join([as_string(x) for x in (channel.view, channel.layer) if x is not None])
    return components or 'default_layer'