Non-UTF-8 source text (Latin-1 CSS/JS/HTML without charset) fails import: 'Runtime declaration payload is not serializable'
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start with artifact intake and the referenced paths src/ArtifactCompiler/RuntimeDeclarations.php:576, src/ArtifactCompiler/StagedTransport.php:895, and ThemeScaffold.php:22; trace where HTML, CSS, JS, JSON, and SVG bytes enter the plan. Check how HTML charset metadata is currently handled, then reproduce the listed cases and verify that declared encodings and invalid UTF-8 input are normalized as expected. Done means all four reported cases compile and runtime declaration serialization succeeds.
由索引模型根据 Issue 内容生成。
描述
Summary
Source text that isn't valid UTF-8 (legacy Latin-1/Windows-1252 sites, uploaded zips) fails the whole import instead of being decoded.
Production: two sessions on 2026-11-28 (SSI 1.39.12, upload sources) failed with:
InvalidArgumentException: Runtime declaration payload is not serializable.
at src/ArtifactCompiler/RuntimeDeclarations.php:576 <- :564 <- src/ArtifactCompiler/StagedTransport.php:895
Repro (trunk, ArtifactCompiler::compile)
Each case has one index.html with a single Latin-1 byte (\xE9) somewhere:
| case | result |
|---|---|
Latin-1 byte in a linked s.css |
JsonException: Malformed UTF-8 characters @ ThemeScaffold.php:22 (uncaught) |
Latin-1 byte in a linked a.js |
failed: wordpress_site_plan_not_self_contained, "Runtime declaration payload is not serializable." |
Latin-1 bytes in HTML text and an inline <script>, no charset meta |
failed: same diagnostic |
Same HTML with <meta charset="iso-8859-1"> |
success_with_warnings |
So the HTML path already decodes when a charset is declared. CSS, JS, and undeclared HTML pass raw non-UTF-8 bytes into the plan, and the JSON encoding of runtime declarations, digests and the theme scaffold rejects them.
Expected
Text artifacts (HTML, CSS, JS, JSON, SVG) are normalized to UTF-8 once, at artifact intake. Use the declared encoding where there is one (<meta charset>, CSS @charset, a BOM). Otherwise, for bytes that aren't valid UTF-8, fall back to Windows-1252, a superset of Latin-1 that matches browser behavior for undeclared legacy pages. Everything downstream can then keep assuming UTF-8, and all four cases above compile.
- 主要语言
- PHP
- 星标
- 31
- 派生
- 7
- 平均合并
- 7 小时 50 分钟
- 30 天内合并 PR
- 822
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Automattic/blocks-engine 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
Automattic/blocks-engine#7679 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
Automattic/blocks-engine#4943 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
Automattic/blocks-engine#4942 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
Automattic/blocks-engine#4921 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
Automattic/blocks-engine#775 ·
维护者通常 1 天内回复
查看 Automattic/blocks-engine 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 86/100
Automattic/static-site-importer#3462 ·
维护者通常 1 天内回复
-
Document lexicon.default.userconfig and lexicon.default.userconfig.enforced in config.sample.php未关闭enhancement feature: settings good first issue
难度 1/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
nextcloud/integration_openai#480 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
roundcube/roundcubemail#10468 ·
维护者通常 1 天内回复