Commit Graph
1 Commits
Author SHA1 Message Date
Ethan GuoandGitHub b3e338ddb2 test(web): cover zip encoder, design-system audit, chat-events, mentions, utils (#2451)
* test(web): cover stored-mode ZIP encoder CRC and central directory

* test(web): cover design-system audit repair-actions and chat-events dedup

* test(web): cover @mention parsing and agent label normalization

* test(web): cover error flattener, prompt-template categories, design-system sentinel

* fix(web): set ZIP UTF-8 filename flag (bit 11) for non-ASCII names

buildZip wrote UTF-8 filename bytes (TextEncoder) but left the
general-purpose bit flag at 0 in both the local and central headers, so
readers fall back to CP437 and mis-decode non-ASCII names like 日本.md.

Set general-purpose bit 11 (0x0800, EFS) in both headers when the
filename contains a non-ASCII byte; pure-ASCII archives are unchanged
(ASCII == CP437 == UTF-8), matching how Python/Go zip encoders behave.

Strengthen the UTF-8 test to assert the flag + filename in BOTH the
local and central-directory headers (parsed via EOCD), and add a case
asserting pure-ASCII names do not set the flag.

Addresses review feedback on #2451.
2026-07-02 09:29:28 +00:00