ensure_ascii on serialise (#6)

This commit is contained in:
BrightonBTC
2022-11-15 12:37:32 +00:00
committed by GitHub
parent ec61b17d87
commit a5153bce68

View File

@@ -36,7 +36,7 @@ class Event():
@staticmethod @staticmethod
def serialize(public_key: str, created_at: int, kind: int, tags: "list[list[str]]", content: str) -> bytes: def serialize(public_key: str, created_at: int, kind: int, tags: "list[list[str]]", content: str) -> bytes:
data = [0, public_key, created_at, kind, tags, content] data = [0, public_key, created_at, kind, tags, content]
data_str = json.dumps(data, separators=(',', ':')) data_str = json.dumps(data, separators=(',', ':'), ensure_ascii=False)
return data_str.encode() return data_str.encode()
@staticmethod @staticmethod