From 601b6b0ea74a9b6ce9904e1af5d786065a1e785a Mon Sep 17 00:00:00 2001 From: Timo Kankare Date: Tue, 11 Oct 2016 22:21:54 +0300 Subject: [PATCH] Writing folder names to config file using UTF-8. json.dumps is allowed to produce unicode and then the string is encoded to UTF-8, so that ConfigParser can write it to file. --- Mailnag/backends/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mailnag/backends/__init__.py b/Mailnag/backends/__init__.py index 331be52..7a3148f 100644 --- a/Mailnag/backends/__init__.py +++ b/Mailnag/backends/__init__.py @@ -41,7 +41,7 @@ def _str_to_folders(folders_str): def _folders_to_str(folders): - return json.dumps(folders) + return json.dumps(folders, ensure_ascii=False).encode('utf-8') def _str_to_bool(string):