Skip to content

fix: code generation always reads and writes files as UTF-8 - #1303

Open
gennaroprota wants to merge 1 commit into
cppalliance:developfrom
gennaroprota:fix/code_generation_always_reads_and_writes_files_as_utf8
Open

gennaroprota wants to merge 1 commit into
cppalliance:developfrom
gennaroprota:fix/code_generation_always_reads_and_writes_files_as_utf8

Conversation

@gennaroprota

@gennaroprota gennaroprota commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

The scripts under utils/codegen opened every file without specifying an encoding, so Python used the locale's preferred one: the ANSI codepage on Windows, UTF-8 elsewhere.

Use UTF-8 everywhere, instead.

Changes

  • Tooling: The code generation scripts read and write files as UTF-8 through a small helper function in each.

Testing

No new test. The behavior is already covered by schema-check.

Documentation

Not needed. Nothing user-visible changes, and no page describes what encoding the generators use.

Closes #1310.

@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

🧾 Changes by Scope

Scope Lines Δ% Lines Δ Lines + Lines - Files Δ Files + Files ~ Files ↔ Files -
🧰 Tooling 100% 37 28 9 4 - 4 - -
Total 100% 37 28 9 4 - 4 - -

Legend: Files + (added), Files ~ (modified), Files ↔ (renamed), Files - (removed)

🔝 Top Files

  • utils/codegen/generate-version-header.py (Tooling): 11 lines Δ (+8 / -3)
  • utils/codegen/generate-yaml-schema.py (Tooling): 11 lines Δ (+8 / -3)
  • utils/codegen/generate-config-info.py (Tooling): 9 lines Δ (+7 / -2)

Generated by 🚫 dangerJS against 318a5df

@codecov

codecov Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.12%. Comparing base (be06d44) to head (318a5df).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1303   +/-   ##
========================================
  Coverage    83.12%   83.12%           
========================================
  Files           35       35           
  Lines         3662     3662           
  Branches       844      844           
========================================
  Hits          3044     3044           
  Misses         410      410           
  Partials       208      208           
Flag Coverage Δ
bootstrap 83.12% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gennaroprota
gennaroprota force-pushed the fix/code_generation_always_reads_and_writes_files_as_utf8 branch from ec9229c to ba18db3 Compare September 14, 2026 13:26
@cppalliance-bot

cppalliance-bot commented Sep 14, 2026

Copy link
Copy Markdown

An automated preview of the documentation is available at https://1303.mrdocs.prtest2.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-09-18 15:29:30 UTC

The scripts under utils/codegen opened every file without specifying an
encoding, so Python used the locale's preferred one: the ANSI codepage
on Windows, UTF-8 elsewhere.

Use UTF-8 everywhere, instead.

Closes cppalliance#1310.
@gennaroprota
gennaroprota force-pushed the fix/code_generation_always_reads_and_writes_files_as_utf8 branch from ba18db3 to 318a5df Compare September 18, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Building on Windows corrupts the generated config schema

2 participants