Merge pull request #899 from oddstr13/pr-hexlify-encode-1

Specify encoding when converting hex-bytestring to string
This commit is contained in:
Odd Stråbø 2024-08-09 15:33:05 +02:00 committed by GitHub
commit 2aa790c88b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -122,7 +122,7 @@ def event(method, data=None, sender=None, hexlify=False):
sender = sender or "plugin.video.jellyfin" sender = sender or "plugin.video.jellyfin"
if hexlify: if hexlify:
data = str(binascii.hexlify(json.dumps(data).encode())) data = str(binascii.hexlify(json.dumps(data).encode()), "utf-8")
data = '"[%s]"' % json.dumps(data).replace('"', '\\"') data = '"[%s]"' % json.dumps(data).replace('"', '\\"')