Converts text.

def cli(out_fmt, input, output):
    """Converts text."""
    _input = StringIO()
    for l in input:
        try:
            _input.write(str(l))
        except TypeError:
            _input.write(bytes(l, 'utf-8'))
    _input = seria.load(_input)
    _out = (_input.dump(out_fmt))
    output.write(_out)