import codecs


def file2list(filepath,
              stripfile=True):
    """
    Loads a file into a list. One line per element.
    :param filepath: Path to the file to load.
    :param stripfile: Whether we should strip the lines of the file or not.
    :return: List containing the lines read.
    """
    with codecs.open(filepath, 'r', encoding='utf-8') as f:
        lines = [k for k in [k.strip() for k in f.readlines()] if len(k) > 0] if stripfile else [k for k in
                                                                                                 f.readlines()]
        return lines