Skip to content

fix(docs): use utf-8 for redirect generation - #8212

Open
Rolly Calma (Ghraven) wants to merge 1 commit into
microsoft:mainfrom
Ghraven:raven-redirects-utf8
Open

fix(docs): use utf-8 for redirect generation#8212
Rolly Calma (Ghraven) wants to merge 1 commit into
microsoft:mainfrom
Ghraven:raven-redirects-utf8

Conversation

@Ghraven

Copy link
Copy Markdown

Summary

  • Read the redirect template and URL list with explicit UTF-8 encoding.
  • Write generated redirect pages with explicit UTF-8 encoding.

Problem

The redirect generation utility currently depends on Python's locale default encoding for text file I/O. That can be inconsistent on Windows and other environments where the locale is not UTF-8.

Before / after

Before, redirect generation used the platform default encoding. After, the same files are read and written as UTF-8 explicitly, making generated docs redirects more reproducible across environments.

Verification

  • python -m py_compile python\\docs\\redirects\\redirects.py
  • python python\\docs\\redirects\\redirects.py $env:TEMP\\autogen_redirect_smoke
  • Checked generated index.html and docs\\Getting-Started\\index.html existed in the temp output folder.
  • git diff --check

Thank you for maintaining AutoGen.

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.

1 participant