Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/cli-reference/base-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ Specify character encoding for input and output files.
The `--encoding` flag sets the character encoding used when reading
the schema file and writing the generated Python code. This is useful
for schemas containing non-ASCII characters (e.g., Japanese, Chinese).
Default is utf-8.
Default is the system's preferred encoding (via `locale.getpreferredencoding()`),
which is typically UTF-8 on Linux/macOS but may differ on Windows (e.g., cp1252).
For consistent cross-platform behavior, explicitly specify `--encoding utf-8`.

!!! tip "Usage"

Expand Down
4 changes: 3 additions & 1 deletion tests/test_main_kr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,9 @@ def test_encoding_option(output_file: Path) -> None:
The `--encoding` flag sets the character encoding used when reading
the schema file and writing the generated Python code. This is useful
for schemas containing non-ASCII characters (e.g., Japanese, Chinese).
Default is utf-8.
Default is the system's preferred encoding (via `locale.getpreferredencoding()`),
which is typically UTF-8 on Linux/macOS but may differ on Windows (e.g., cp1252).
For consistent cross-platform behavior, explicitly specify `--encoding utf-8`.
"""
run_main_and_assert(
input_path=JSON_SCHEMA_DATA_PATH / "encoding_test.json",
Expand Down
Loading