From: Oleg Broytman Date: Mon, 13 Nov 2023 14:36:01 +0000 (+0300) Subject: Fix(Py3): Open output text files in utf-8 encoding X-Git-Tag: 5.0.0~39 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=865ee60d6e5813866423b4481ff5ed3411a1a7fe;p=bookmarks_db.git Fix(Py3): Open output text files in utf-8 encoding --- diff --git a/db2bkmk.py b/db2bkmk.py index 07e2756..4e50101 100755 --- a/db2bkmk.py +++ b/db2bkmk.py @@ -97,7 +97,7 @@ def run(): root_folder.walk_depth(Transl(transl_d)) - outfile = open(output_filename, 'w') + outfile = open(output_filename, 'w', encoding='utf-8') root_folder.walk_depth(writer(outfile, prune)) outfile.close() diff --git a/sort_db.py b/sort_db.py index 143c7d1..bcd3a8e 100755 --- a/sort_db.py +++ b/sort_db.py @@ -99,7 +99,7 @@ def run(): sys.stdout.write("Writing %s: " % output_filename) sys.stdout.flush() - outfile = open(output_filename, 'w') + outfile = open(output_filename, 'w', encoding='utf-8') writer = writer(outfile) writer.root_folder(root_folder) walk_linear(linear, writer)