From 8376e406e5f84fd20d5dc9848a197af82cd56301 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Sat, 12 Aug 2017 16:44:17 +0200 Subject: [PATCH] [modules/datetime] Add encoding for locale When creating the date/time string, use the locale's preferred encoding to format the string. hopefully, this fixes #158 --- bumblebee/modules/datetime.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bumblebee/modules/datetime.py b/bumblebee/modules/datetime.py index 74fae8b..a8842c6 100644 --- a/bumblebee/modules/datetime.py +++ b/bumblebee/modules/datetime.py @@ -35,6 +35,7 @@ class Module(bumblebee.engine.Module): locale.setlocale(locale.LC_TIME, lcl.split(".")) def get_time(self, widget): - return datetime.datetime.now().strftime(self._fmt) + enc = locale.getpreferredencoding() + return datetime.datetime.now().strftime(self._fmt).decode(enc) # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4