[BUG] Artifact: HTML without <meta charset> renders UTF-8 as mojibake (skeleton charset not applied)
Summary
An HTML page published with the Artifact tool that doesn't include its own <meta charset> renders UTF-8 characters as mojibake on claude.ai. The Artifact tool's page contract says the file is wrapped in a skeleton whose head "carries only a charset and viewport meta", so authors are told not to add their own <html>/<head>. The page renders as if no charset applied.
Steps to reproduce
- In Claude Code, write an HTML file with no
<meta charset>(per the contract:<title>,<style>, then content), containing non-ASCII text, e.g.:
``html``
<title>Charset Repro</title>
<p>v5 “AppZapper 3000 License”: Download · Drag → Unlock</p>
- Publish it with the Artifact tool (
action: publish). - Open the artifact URL on claude.ai.
Expected
v5 “AppZapper 3000 License”: Download · Drag → Unlock
Actual
v5 “AppZapper 3000 Licenseâ€: 3 steps, Download · Drag into Applications · Unlock
This is UTF-8 read as windows-1252 (· = C2 B7 → ·; “ = E2 80 9C → “), i.e. the browser's legacy fallback when no charset is declared in the HTTP Content-Type header, a meta tag or a BOM.
Workaround
Adding <meta charset="utf-8"> as the first line of the file (and/or entity-encoding non-ASCII chars) fixes it. Republishing the same page with that line rendered correctly.
Suggested fix
Serve artifact HTML with Content-Type: text/html; charset=utf-8 and/or ensure the skeleton's <meta charset="utf-8"> is emitted within the first 1024 bytes, before any author content.
Environment
- Claude Code 2.1.280 (Claude Code) (CLI, macOS), model Opus 5.5
- Artifact tool, publish action, private artifact viewed on claude.ai
- Observed 2026-09-23