From ac208c177a7ac31a1336655c34aff9a4fce3533b Mon Sep 17 00:00:00 2001 From: Donald Tse Date: Sun, 2 Mar 2025 12:42:04 +0000 Subject: [PATCH] simple fix for input/output filehandler with encoding utf-8 --- ics_splitter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ics_splitter.py b/ics_splitter.py index fac1aa6..f5f46a2 100644 --- a/ics_splitter.py +++ b/ics_splitter.py @@ -28,7 +28,7 @@ print('ERROR: output file already exists! As a safety check, this script will not overwrite an ICS file') exit() - infh = open(in_fname, 'r') + infh = open(in_fname, 'r', encoding='utf-8') # parsing constants BEGIN_CALENDAR = 'BEGIN:VCALENDAR' @@ -46,7 +46,7 @@ event_count = 0 out_event_count = 0 - with open(out_fname, 'w') as outfh: + with open(out_fname, 'w', encoding='utf-8')) as outfh: for line in infh: if in_preamble and line.startswith(BEGIN_EVENT): in_preamble = False