#4779: fix: Add UTF-8 encoding to SKILL.md read operation (fixes #4661)
Cluster:
Skill Enhancements and Fixes
## Problem
Issue #4661 reported a `UnicodeDecodeError` when validating skills on Windows systems. The error occurred because:
1. The skill validation script reads `SKILL.md` files using `Path.read_text()` without specifying an encoding
2. On Windows systems with non-UTF-8 default encoding (e.g., GBK on Chinese Windows), Python defaults to the system encoding
3. When SKILL.md contains UTF-8 characters (like smart quotes, em dashes, or emoji), the GBK decoder fails
## Error
```
UnicodeDecodeError: 'gbk' codec can't decode byte 0x92 in position 822: illegal multibyte sequence
```
## Solution
Added explicit `encoding='utf-8'` parameter to the `read_text()` call in `quick_validate.py`:
```python
# Before
content = skill_md.read_text()
# After
content = skill_md.read_text(encoding='utf-8')
```
This ensures consistent UTF-8 handling across all platforms (Windows, macOS, Linux) regardless of system default encoding.
## Testing
- ✅ Python syntax validation passes
- ✅ One-line change, minimal risk
- ✅ Standard Python best practice for reading text files
## Related
Fixes #4661
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates the skill validation helper (`skills/skill-creator/scripts/quick_validate.py`) to read `SKILL.md` with an explicit `encoding='utf-8'` when calling `Path.read_text()`. This makes skill validation consistent across platforms and prevents Windows-specific `UnicodeDecodeError` failures when the system default encoding is not UTF-8 (e.g., GBK).
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- The change is a one-line, narrowly scoped fix that removes platform-dependent default decoding for `SKILL.md` and matches the intended UTF-8 content encoding.
- No files require special attention
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#3933: fix(skills): Make skill scripts executable
by jaysonsantos · 2026-01-29
72.7%
#13012: Security: detect invisible Unicode in skills and plugins (ASCII smu...
by agentwuzzi · 2026-02-10
71.7%
#9227: Fix: Windows Web UI shows 'brew not installed' for all skills
by vishaltandale00 · 2026-02-05
71.3%
#9925: docs: warn about Python venv placement in skill directories
by kj9kj9qv4m-bit · 2026-02-05
71.3%
#5273: fix: skill frontmatter fixes + description improvements (35 skills)
by Terwox · 2026-01-31
70.8%
#19664: fix(skills): log skill YAML parsing diagnostics with skill name
by orchidsun · 2026-02-18
70.7%
#23079: fix(skills): fallback to npm for summarize skill on non-darwin systems
by charojo · 2026-02-22
70.6%
#22306: Warn on malformed skill parsing failures in load path
by AIflow-Labs · 2026-02-21
70.4%
#10705: security: extend skill scanner to detect threats in markdown skill ...
by Alex-Alaniz · 2026-02-06
69.8%
#8873: fix: document skill loading locations in system prompt
by ytfh44 · 2026-02-04
69.7%