def _remove_end_characters(line):
    """Removes line ending characters"""
    if line[-2:] == '\r\n':
        return line[:-2], True
    elif line[-1:] in '\r\n':
        return line[:-1], True
    return line, False
