You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(office): decode redlining diffs as UTF-8 - #1765
For each of the three validators, I ran _get_git_word_diff() with Polish and Japanese text and confirmed the returned diff preserved 日本語. I also ran python3 -m compileall for the office validator modules and git diff --check.
The encoding="utf-8" fix is correct — subprocess.run(text=True) decodes with the locale encoding, so non-ASCII redlining diffs blow up on non-UTF-8 locales (e.g. cp1252 on Windows). Good catch.
Process note: #1766 currently also carries these same redlining hunks (stacked PRs), and #1764 duplicates open PR #1734. Recommend rebasing so each PR contains only its own diff to keep review/merge clean. Thanks!
Rebased this branch onto current main so it now contains only the UTF-8 decoding changes in the three redlining validators. The duplicated orphaned-comment hunk from #1764 is removed; current head is 0f297bb.
Confirmed clean after rebase: the branch now contains only the three encoding="utf-8" additions (docx/pptx/xlsx redlining validators, both subprocess.run call sites each, +6 lines total). The fix is correct — with text=True and no explicit encoding, subprocess decodes stdout/stderr with the locale codec, so non-ASCII word-diff output crashes on non-UTF-8 locales (e.g. cp1252 on Windows). LGTM from the review side; nothing further needed here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
git diffoutput as UTF-8 in the DOCX, PPTX, and XLSX redlining validatorsFixes #1707
Validation
For each of the three validators, I ran
_get_git_word_diff()with Polish and Japanese text and confirmed the returned diff preserved日本語. I also ranpython3 -m compileallfor the office validator modules andgit diff --check.