Skip to content

Recognize UTF-8 BOMs in carved text payloads - #8816

Open
danzig666 wants to merge 1 commit into
ItsNotRexed:mainfrom
danzig666:fix/gamedata-text-payload-bom
Open

danzig666 wants to merge 1 commit into
ItsNotRexed:mainfrom
danzig666:fix/gamedata-text-payload-bom

Conversation

@danzig666

Copy link
Copy Markdown

Summary

  • Sample printable bytes after a leading UTF-8 BOM so short carved text streams still reach the text parser.
  • Strip the BOM before parsing preload stems and VFX settings. Keep the original payload sizes and offsets.

ASSET-GAMEDATA-TEXT-BOM claim: #8683 (comment)

Verification

  • Both new regressions reproduced on base. The short preload was treated as binary and the longer preload kept the BOM in its first stem. The fixed code also counts the first VFX comment correctly.
  • All 32 game-data index tests and 9 of 10 blob tests passed. The other blob test expects exit 1 for a missing path. Base already returns 2, and tests/test_gamedata_blobs: match exit 2 and ERROR: prefix for missing input after #6701 #7646 covers that expectation.
  • A read-only comparison on one small retail archive produced five identical reports, including three text payloads. The no-game-data guard and git diff --check passed.
  • The semantic run covered 5,957 tests and reproduced the existing failures in test_image_atomics_guard and test_image_store_d16.

AI-assisted: yes (Codex)

@Grimkeh Grimkeh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent Linux CPU review (796aa3d2)

What changed: recognize UTF-8 BOMs in carved text payloads.

Checked: suite mostly OK; test_gamedata_blobs::test_missing_file_names_what_is_wrong is already red on main (expects exit 1; tool returns 2) — not introduced here.

Looks fine for the BOM change; no game files.

@Grimkeh

Grimkeh commented Nov 23, 2026

Copy link
Copy Markdown

Overlap note: #8820 also edits tools/gamedata_blobs.py (JSON preserve-on-write-fail). Whichever lands second will need a rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants