fix: decode feature.json as UTF-8 in Windows PowerShell - #4359
Open
hamedrabah wants to merge 2 commits into
Open
fix: decode feature.json as UTF-8 in Windows PowerShell#4359hamedrabah wants to merge 2 commits into
hamedrabah wants to merge 2 commits into
Conversation
Assisted-by: Codex (model: GPT-5, autonomous)
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes UTF-8 decoding of feature.json in Windows PowerShell 5.1.
Changes:
- Reads existing feature configuration explicitly as UTF-8.
- Adds a Windows PowerShell regression test for Unicode paths.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
scripts/powershell/common.ps1 |
Uses UTF-8 decoding for both feature JSON reads. |
tests/test_check_prerequisites_paths_only.py |
Adds the Unicode-path regression test. |
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Assisted-by: Codex (model: GPT-5, autonomous)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Fixes #4333.
Windows PowerShell 5.1 decodes
Get-Content -Rawwith the active ANSI code page, so a BOM-less UTF-8feature.jsoncan corrupt non-ASCII feature paths before JSON parsing. Read both existingfeature.jsonpaths withSystem.IO.File.ReadAllText(..., Encoding.UTF8)instead.The regression writes a BOM-less UTF-8 feature directory containing Chinese characters, invokes
Get-FeaturePathsEnvunder Windows PowerShell 5.1, and verifies the exact resolved path.Testing
uv run specify --helpuv sync && uv run pytestAdditional checks:
python3 -m py_compile tests/test_check_prerequisites_paths_only.pygit diff --checkuv synccould not complete because the configured package registry was unreachable, so CI still needs to execute the test on Windows PowerShell 5.1.AI Disclosure
Codex (GPT-5, autonomous) assisted with issue investigation, implementation, test design, and review. The resulting diff and repository requirements were manually reviewed before submission.