From 9da1051f832c4adb7d7f1136d1e4c3dc565829a9 Mon Sep 17 00:00:00 2001 From: Griatch Date: Wed, 17 Aug 2016 18:37:31 +0200 Subject: [PATCH] Fix a bug in to_str() that caused it to not actually try alternative encodings when converting. --- evennia/utils/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evennia/utils/utils.py b/evennia/utils/utils.py index 17b4ecf6c9..1e9c0c48a1 100644 --- a/evennia/utils/utils.py +++ b/evennia/utils/utils.py @@ -636,7 +636,7 @@ def to_str(obj, encoding='utf-8', force_string=False): except UnicodeEncodeError: for alt_encoding in ENCODINGS: try: - obj = obj.encode(encoding) + obj = obj.encode(alt_encoding) return obj except UnicodeEncodeError: pass