]> git.aero2k.de Git - urlbot-v3.git/commitdiff
encode string for routing key before truncating it
authorThorsten <mail@aero2k.de>
Wed, 25 Mar 2020 21:00:28 +0000 (22:00 +0100)
committerThorsten <mail@aero2k.de>
Wed, 25 Mar 2020 21:00:28 +0000 (22:00 +0100)
distbot/bot/bot.py

index 52ba9239e0dde8b9e363437025ab415edbd07b8b..e2ce04300a48b03361c4185089aada804e3fcc60 100644 (file)
@@ -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):