From: Thorsten Date: Wed, 25 Mar 2020 21:00:28 +0000 (+0100) Subject: encode string for routing key before truncating it X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=6d4f9d0f21b327a3ea2037e08d69f4697f084fbe;p=urlbot-v3.git encode string for routing key before truncating it --- diff --git a/distbot/bot/bot.py b/distbot/bot/bot.py index 52ba923..e2ce043 100644 --- a/distbot/bot/bot.py +++ b/distbot/bot/bot.py @@ -122,7 +122,7 @@ class Bot(sleekxmpp.ClientXMPP): else: key.pop(0) key.insert(0, "nick") - routing_key = '.'.join(key)[:254] + routing_key = '.'.join(key).encode("UTF-8")[:255] return routing_key def message(self, msg):