autogen
autogen copied to clipboard
docs: use explicit utf-8 encoding in redirects script
Why are these changes needed?
This PR updates the docs redirect generation script to use explicit UTF-8 encoding when reading and writing text files.
Currently, python/docs/redirects/redirects.py relies on Python's default system encoding when:
- reading
redirect_template.html - reading
redirect_urls.txt - writing generated redirect
index.htmlfiles
This can be less portable on environments where the default encoding is not UTF-8, such as some Windows locales.
Related issue number
Closes #7749
Checks
- [x] I've included any doc changes needed for https://microsoft.github.io/autogen/. See https://github.com/microsoft/autogen/blob/main/CONTRIBUTING.md to build and test documentation locally.
- [ ] I've added tests (if relevant) corresponding to the changes introduced in this PR.
- [x] I've made sure all auto checks have passed.
Local check:
python -m py_compile python/docs/redirects/redirects.py```