Skip to content

Commit 3a1835f

Browse files
committed
Fix some unicode support issues
1 parent 15f67ce commit 3a1835f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

threema/gateway/e2e.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def add_callback_route(
246246
if receive_handler is None:
247247
receive_handler = Message.receive
248248
context = CallbackContext(
249-
connection.secret.encode('ascii'),
249+
connection.secret.encode('utf-8'),
250250
connection,
251251
message_handler,
252252
receive_handler,
@@ -1288,7 +1288,7 @@ async def pack(self, writer):
12881288

12891289
# Pack payload (compact JSON encoding)
12901290
try:
1291-
content = json.dumps(content, separators=(',', ':')).encode('ascii')
1291+
content = json.dumps(content, separators=(',', ':')).encode('utf-8')
12921292
except UnicodeError as exc:
12931293
raise MessageError('Could not encode JSON') from exc
12941294

0 commit comments

Comments
 (0)