def _readlines(fname, fpointer1=open, fpointer2=open):
    """Read all lines from file."""
    try:
        with fpointer1(fname, 'r') as fobj:
            return fobj.readlines()
    except UnicodeDecodeError:
        with fpointer2(fname, 'r', encoding='utf-8') as fobj:
            return fobj.readlines()
