Skip to content

fix: add explicit UTF-8 encoding to file operations in playwright_controller#7465

Open
Spectual wants to merge 1 commit intomicrosoft:mainfrom
Spectual:fix/utf8-encoding-playwright-controller
Open

fix: add explicit UTF-8 encoding to file operations in playwright_controller#7465
Spectual wants to merge 1 commit intomicrosoft:mainfrom
Spectual:fix/utf8-encoding-playwright-controller

Conversation

@Spectual
Copy link
Copy Markdown

Summary

Add explicit encoding="utf-8" parameter to open() calls in playwright_controller.py and related files in the ext-agent-surfer package.

Motivation

On non-English Windows systems, open() defaults to the system locale encoding (e.g., cp1252, gbk) rather than UTF-8. This causes UnicodeDecodeError when reading files containing non-ASCII characters.

Fixes #5566

Changes

  • Added encoding="utf-8" to all text file open() calls in playwright_controller.py
  • Also fixed similar issues in other files within the same package for consistency

Testing

  • Verified syntax correctness of all modified files
  • Changes are minimal and low-risk (only adding encoding parameter to existing open calls)

@Spectual Spectual force-pushed the fix/utf8-encoding-playwright-controller branch from fca5662 to 375c01b Compare March 26, 2026 05:10
@Spectual
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@Spectual Spectual force-pushed the fix/utf8-encoding-playwright-controller branch from 375c01b to 1ec82d4 Compare March 27, 2026 05:29
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.

open needs encoding='utf-8' for non-english environment, error in playwright_controller.py

1 participant