From 4e3308bd9a07bd92ad3999f950e4420c9f10fa00 Mon Sep 17 00:00:00 2001 From: sergiomarotco <29877074+sergiomarotco@users.noreply.github.com> Date: Thu, 29 Aug 2024 02:09:29 +0700 Subject: [PATCH] UTF-8 for export script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Чтобы скрипт выгружал в UTF-8 сразу --- scripts/convert_database_to_other_formats.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/convert_database_to_other_formats.py b/scripts/convert_database_to_other_formats.py index cb77402..a438863 100644 --- a/scripts/convert_database_to_other_formats.py +++ b/scripts/convert_database_to_other_formats.py @@ -29,11 +29,11 @@ def main() -> None: } for column_data in column_datas ] - with open(JSON_OUTFILE_PATH, "w") as fp: + with open(JSON_OUTFILE_PATH, "w", encoding="utf-8") as fp: json.dump(json_data, fp, ensure_ascii=False, indent=4) # To csv - with open(CSV_OUTFILE_PATH, "w", newline='') as fp: + with open(CSV_OUTFILE_PATH, "w", newline='', encoding="utf-8") as fp: csv_writer = csv.writer(fp) csv_writer.writerow(row_names) for column_data in column_datas: