From dcddedb3b3c403db0364a9488274abf7013ce2ec Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Fri, 19 Dec 2025 07:28:18 +0000 Subject: [PATCH 1/2] docs: Clarify default encoding behavior and cross-platform considerations --- docs/cli-reference/base-options.md | 4 +++- docs/cli-reference/model-customization.md | 2 +- docs/cli-reference/template-customization.md | 2 +- tests/test_main_kr.py | 4 +++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/cli-reference/base-options.md b/docs/cli-reference/base-options.md index 532a6cd0c..3087801b4 100644 --- a/docs/cli-reference/base-options.md +++ b/docs/cli-reference/base-options.md @@ -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" diff --git a/docs/cli-reference/model-customization.md b/docs/cli-reference/model-customization.md index 164dd4110..ef61ec721 100644 --- a/docs/cli-reference/model-customization.md +++ b/docs/cli-reference/model-customization.md @@ -4008,7 +4008,7 @@ The `--target-python-version` flag controls Python version-specific syntax: This affects import statements and type annotation syntax in generated code. -**See also:** [Output Model Types](../what_is_the_difference_between_v1_and_v2.md), [CI/CD Integration](../ci-cd.md), [Python Version Compatibility](../python-version-compatibility.md) +**See also:** [Python Version Compatibility](../python-version-compatibility.md), [CI/CD Integration](../ci-cd.md), [Output Model Types](../what_is_the_difference_between_v1_and_v2.md) !!! tip "Usage" diff --git a/docs/cli-reference/template-customization.md b/docs/cli-reference/template-customization.md index 1796b65bb..62578714a 100644 --- a/docs/cli-reference/template-customization.md +++ b/docs/cli-reference/template-customization.md @@ -2208,7 +2208,7 @@ the generated Python code. Available formatters are: black, isort, ruff, yapf, autopep8, autoflake. Default is [black, isort]. Use this to customize formatting or disable formatters entirely. -**See also:** [CI/CD Integration](../ci-cd.md), [Code Formatting](../formatting.md) +**See also:** [Code Formatting](../formatting.md), [CI/CD Integration](../ci-cd.md) !!! tip "Usage" diff --git a/tests/test_main_kr.py b/tests/test_main_kr.py index d0efb0a38..a1bdb986e 100644 --- a/tests/test_main_kr.py +++ b/tests/test_main_kr.py @@ -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", From 43381f5668df714e4b2e1cdfaba316e393c8ce45 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 19 Dec 2025 07:29:04 +0000 Subject: [PATCH 2/2] docs: update CLI reference documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated by GitHub Actions --- docs/cli-reference/model-customization.md | 2 +- docs/cli-reference/template-customization.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/cli-reference/model-customization.md b/docs/cli-reference/model-customization.md index ef61ec721..164dd4110 100644 --- a/docs/cli-reference/model-customization.md +++ b/docs/cli-reference/model-customization.md @@ -4008,7 +4008,7 @@ The `--target-python-version` flag controls Python version-specific syntax: This affects import statements and type annotation syntax in generated code. -**See also:** [Python Version Compatibility](../python-version-compatibility.md), [CI/CD Integration](../ci-cd.md), [Output Model Types](../what_is_the_difference_between_v1_and_v2.md) +**See also:** [Output Model Types](../what_is_the_difference_between_v1_and_v2.md), [CI/CD Integration](../ci-cd.md), [Python Version Compatibility](../python-version-compatibility.md) !!! tip "Usage" diff --git a/docs/cli-reference/template-customization.md b/docs/cli-reference/template-customization.md index 62578714a..1796b65bb 100644 --- a/docs/cli-reference/template-customization.md +++ b/docs/cli-reference/template-customization.md @@ -2208,7 +2208,7 @@ the generated Python code. Available formatters are: black, isort, ruff, yapf, autopep8, autoflake. Default is [black, isort]. Use this to customize formatting or disable formatters entirely. -**See also:** [Code Formatting](../formatting.md), [CI/CD Integration](../ci-cd.md) +**See also:** [CI/CD Integration](../ci-cd.md), [Code Formatting](../formatting.md) !!! tip "Usage"