From aa420a39ae6c4a23e4b45abc8fadd2e85a039201 Mon Sep 17 00:00:00 2001 From: Piyush Tiwari Date: Mon, 26 Oct 2026 14:36:00 +0530 Subject: [PATCH] Revert "fix: preserve non-ASCII characters in format_json (#8)" --- fixit/jsonfmt.py | 2 +- tests/test_jsonfmt.py | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/fixit/jsonfmt.py b/fixit/jsonfmt.py index e427e00..89ba00f 100644 --- a/fixit/jsonfmt.py +++ b/fixit/jsonfmt.py @@ -11,6 +11,6 @@ def format_json(raw: str, indent: int = 2) -> str: """ try: data = json.loads(raw) - return json.dumps(data, indent=indent, ensure_ascii=False) + return json.dumps(data, indent=indent) except json.JSONDecodeError: raise ValueError("Invalid JSON") diff --git a/tests/test_jsonfmt.py b/tests/test_jsonfmt.py index 24a5a25..dbdb514 100644 --- a/tests/test_jsonfmt.py +++ b/tests/test_jsonfmt.py @@ -10,8 +10,3 @@ def test_format_json(): def test_invalid_json_friendly_error(): with pytest.raises(ValueError, match="Invalid JSON"): format_json("{not json") - - -def test_format_json_preserves_unicode(): - assert format_json('{"name": "café"}') == '{\n "name": "café"\n}' -