diff --git a/xl2times/__main__.py b/xl2times/__main__.py index 0feeb3c..a90b6dd 100644 --- a/xl2times/__main__.py +++ b/xl2times/__main__.py @@ -332,6 +332,7 @@ def produce_times_tables( def write_dd_files( tables: Dict[str, DataFrame], config: datatypes.Config, output_dir: str ): + encoding = "utf-8" os.makedirs(output_dir, exist_ok=True) for item in os.listdir(output_dir): if item.endswith(".dd"): @@ -369,11 +370,13 @@ def convert_parameter(tablename: str, df: DataFrame): tables_in_file = { "ts.dd": ["ALL_TS"], "milestonyr.dd": ["MILESTONYR"], - "output.dd": [t for t in config.dd_table_order if t != "ALL_TS"], + "output.dd": [ + t for t in config.dd_table_order if t not in ["ALL_TS", "MILESTONYR"] + ], } for fname, tablenames in tables_in_file.items(): - with open(os.path.join(output_dir, fname), "w") as fout: + with open(os.path.join(output_dir, fname), "w", encoding=encoding) as fout: for tablename in [t for t in tablenames if t in tables]: df = tables[tablename] if tablename in sets: