Skip to content

Fix issue 5566: encoding='utf-8' for playwright_controller - #8010

Open
wasim-builds wants to merge 2 commits into
microsoft:mainfrom
wasim-builds:fix-issue-5566
Open

Fix issue 5566: encoding='utf-8' for playwright_controller#8010
wasim-builds wants to merge 2 commits into
microsoft:mainfrom
wasim-builds:fix-issue-5566

Conversation

@wasim-builds

@wasim-builds wasim-builds commented Jul 30, 2026

Copy link
Copy Markdown

Fixes #5566

Problem

playwright_controller.py opens files without explicitly specifying UTF-8 encoding. On systems where the default encoding is not UTF-8 (e.g., Windows with GBK/CP1252), this causes UnicodeDecodeError or UnicodeEncodeError when reading/writing web page content containing non-ASCII characters.

Fix

Add encoding='utf-8' to the file open call in playwright_controller.py. This ensures consistent behavior across all platforms regardless of system locale.

Scope

Single-line change in python/packages/autogen-ext/src/autogen_ext/agents/web_surfer/playwright_controller.py.

Verification

The web surfer agent can now scrape and interact with pages containing non-ASCII content (Chinese, emoji, accented characters) on Windows, Linux, and macOS without encoding errors.

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