Files
mc-marcocheng 0cb4c81492 fix(skills): enforce utf-8 encoding when materializing skill files on Windows
Merge https://github.com/google/adk-python/pull/5820

### Link to Issue or Description of Change

**1. Link to an existing issue (if applicable):**

- Closes: #5819
- Related: #5819

**2. Or, if no issue exists, describe the change:**

**Problem:**
When running the ADK on Windows, executing a skill script via `_SkillScriptCodeExecutor` fails with a `UnicodeEncodeError` if the skill's resources (references, assets, or scripts) contain non-ASCII characters. The generated wrapper script writes these files without specifying an encoding, causing Windows to fall back to its system locale encoding (e.g., `cp1252`).

**Solution:**
By explicitly setting `encoding='utf-8'` when `mode == 'w'` in the generated wrapper script, we ensure that text files are correctly written regardless of the system's default locale encoding. Binary assets (`mode == 'wb'`) continue to be handled properly without an encoding argument.

Co-authored-by: Xuan Yang <xygoogle@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/5820 from mc-marcocheng:fix/skill-toolset-utf8 eecabb62d28e59dd17839f20846027d596d58551
PiperOrigin-RevId: 933844065
2026-06-17 11:50:00 -07:00
..
2026-01-20 14:50:09 -08:00