From e3d1866b0f001844d098acb4580a0a224a145325 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 15 Feb 2014 15:51:22 +0100 Subject: [PATCH] Fixed unicode-decode error if sending a non-ascii character from a non-UTF-8 terminal. --- src/commands/cmdhandler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/commands/cmdhandler.py b/src/commands/cmdhandler.py index fc8d23247..35e902ea8 100644 --- a/src/commands/cmdhandler.py +++ b/src/commands/cmdhandler.py @@ -42,7 +42,7 @@ from django.conf import settings from src.comms.channelhandler import CHANNELHANDLER from src.utils import logger, utils from src.commands.cmdparser import at_multimatch_cmd -from src.utils.utils import string_suggestions, make_iter +from src.utils.utils import string_suggestions, make_iter, to_unicode from django.utils.translation import ugettext as _ @@ -270,6 +270,9 @@ def cmdhandler(called_by, raw_string, testing=False, callertype="session", sessi Note that this function returns a deferred! """ + + raw_string = to_unicode(raw_string, force_string=True) + session, player, obj = None, None, None if callertype == "session": session = called_by