From 46a5ff8d97661df8fe85e3da586d8ecd0a47d003 Mon Sep 17 00:00:00 2001 From: Artem Sorokin Date: Thu, 16 Jul 2015 15:14:54 +0300 Subject: [PATCH] Support utf8 for commands. --- asterisk/manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asterisk/manager.py b/asterisk/manager.py index 5846475..2f84f68 100644 --- a/asterisk/manager.py +++ b/asterisk/manager.py @@ -263,7 +263,7 @@ class Manager(object): # lock the socket and send our command try: - self._sock.write(command.encode('ascii')) + self._sock.write(command.encode('utf8')) self._sock.flush() except socket.error as e: raise ManagerSocketException(e.errno, e.strerror) @@ -291,7 +291,7 @@ class Manager(object): try: lines = [] for line in self._sock: - line = line.decode('ascii') + line = line.decode('utf8') # check to see if this is the greeting line if not self.title and '/' in line and not ':' in line: # store the title of the manager we are connecting to: