From 6d4f9d0f21b327a3ea2037e08d69f4697f084fbe Mon Sep 17 00:00:00 2001 From: Thorsten Date: Wed, 25 Mar 2020 22:00:28 +0100 Subject: [PATCH] encode string for routing key before truncating it --- distbot/bot/bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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): -- 2.39.2