55import logging
66import os
77import sys
8+ import unicodedata
89from datetime import datetime
910
1011try :
@@ -729,14 +730,31 @@ def get_logger(log_suffix):
729730 return logger
730731
731732
733+ def strip_unicode (text : str ) -> str :
734+ """
735+ Strip Unicode characters from the given text.
736+
737+ Parameters
738+ ----------
739+ text : str
740+ The input text from which to strip Unicode characters.
741+
742+ Returns
743+ -------
744+ str
745+ The text with Unicode characters removed.
746+ """
747+ return "" .join (c for c in text if ord (c ) < 128 )
748+
749+
732750def print_completion_message (report_type : str ):
733751 """
734752 Prints a formatted completion message after report generation.
735753 """
736754 border = "─" * 65 # Creates a separator line
737755 if report_type == "streamlit" :
738- print (
739- """ 🚀 Streamlit Report Generated!
756+ msg = """
757+ 🚀 Streamlit Report Generated!
740758
741759📂 All scripts to build the Streamlit app are available at:
742760 streamlit_report/sections
@@ -749,10 +767,9 @@ def print_completion_message(report_type: str):
749767🛠️ Advanced users can modify the Python scripts directly in:
750768 streamlit_report/sections
751769"""
752- )
753770 else :
754- print (
755- f""" 🚀 { report_type .capitalize ()} Report Generated!
771+ msg = f"""
772+ 🚀 { report_type .capitalize ()} Report Generated!
756773
757774📂 Your { report_type } report is available at:
758775 quarto_report
@@ -762,8 +779,11 @@ def print_completion_message(report_type: str):
762779🛠️ Advanced users can modify the report template directly in:
763780 quarto_report/quarto_report.qmd
764781"""
765- )
766-
782+ try :
783+ print (msg )
784+ except UnicodeEncodeError :
785+ msg = strip_unicode (msg )
786+ print (msg )
767787 print (border )
768788
769789
0 commit comments