def convert_to_utf8(subtitle_path, output_path):
    """
    Converts subtitle file encoding to UTF-8.
    """
    try:
        with open(subtitle_path, 'r', encoding='iso-8859-1') as file:
            content = file.read()

        with open(output_path, 'w', encoding='utf-8') as file:
            file.write(content)
        logging.info(f"Subtitle encoding converted: {output_path}")
    except Exception as e:
        logging.error(f"Error during subtitle conversion: {e}")

    Converts subtitle file encoding to UTF-8.
    
subtitler.py