File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,9 @@ Specify character encoding for input and output files.
1919The ` --encoding ` flag sets the character encoding used when reading
2020the schema file and writing the generated Python code. This is useful
2121for schemas containing non-ASCII characters (e.g., Japanese, Chinese).
22- Default is utf-8.
22+ Default is the system's preferred encoding (via ` locale.getpreferredencoding() ` ),
23+ which is typically UTF-8 on Linux/macOS but may differ on Windows (e.g., cp1252).
24+ For consistent cross-platform behavior, explicitly specify ` --encoding utf-8 ` .
2325
2426!!! tip "Usage"
2527
Original file line number Diff line number Diff line change @@ -1284,7 +1284,9 @@ def test_encoding_option(output_file: Path) -> None:
12841284 The `--encoding` flag sets the character encoding used when reading
12851285 the schema file and writing the generated Python code. This is useful
12861286 for schemas containing non-ASCII characters (e.g., Japanese, Chinese).
1287- Default is utf-8.
1287+ Default is the system's preferred encoding (via `locale.getpreferredencoding()`),
1288+ which is typically UTF-8 on Linux/macOS but may differ on Windows (e.g., cp1252).
1289+ For consistent cross-platform behavior, explicitly specify `--encoding utf-8`.
12881290 """
12891291 run_main_and_assert (
12901292 input_path = JSON_SCHEMA_DATA_PATH / "encoding_test.json" ,
You can’t perform that action at this time.
0 commit comments