From 7667441f828f990cf17449ba2e28f8dc07eb15b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Andr=C3=A9?= Date: Wed, 29 May 2019 22:32:50 +0200 Subject: [PATCH] Treat string as utf8 in wrap_in_box helper This prevents an UnicodeEncodeError when translation has UTF8 characters. --- linux_story/helper_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux_story/helper_functions.py b/linux_story/helper_functions.py index f9c68b3..17557d4 100644 --- a/linux_story/helper_functions.py +++ b/linux_story/helper_functions.py @@ -323,7 +323,7 @@ def reduction(memo, line): def format_line(line): num_padding = max_characters - len(strip_formatting(line)) - return "| {} |".format(line + (" " * num_padding)) + return u"| {} |".format(line + (" " * num_padding)) max_characters = reduce(reduction, lines, 0) outer_line = " {} ".format("-" * (max_characters + 2))