diff --git a/posthog/temporal/batch_exports/utils.py b/posthog/temporal/batch_exports/utils.py index 3de46eb2032d0..5c2c581a90f7a 100644 --- a/posthog/temporal/batch_exports/utils.py +++ b/posthog/temporal/batch_exports/utils.py @@ -144,7 +144,7 @@ def as_py(self) -> dict | None: except orjson.JSONDecodeError: pass - json_bytes = value.encode("unicode-escape").decode("utf-8", "replace").encode("utf-8") + json_bytes = value.encode("unicode-escape").decode("utf-8", "replace").encode("unicode-escape") try: return orjson.loads(json_bytes) except orjson.JSONDecodeError: @@ -154,7 +154,7 @@ def as_py(self) -> dict | None: # Handles non-valid JSON strings like `'"$set": "Something"'` by quoting them. value = f'"{value}"' - json_bytes = value.encode("unicode-escape").decode("utf-8", "replace").encode("utf-8") + json_bytes = value.encode("unicode-escape").decode("utf-8", "replace").encode("unicode-escape") try: return orjson.loads(json_bytes) except orjson.JSONDecodeError: