BIP 3 limits the Title header to 50 characters. However, buildtable.pl reads the preamble without decoding UTF-8, so length() counts bytes and rejects some titles within that limit.
For example, the existing BIP 450 title, Formosa—Seed encoding by themed mnemonic stories, contains 48 characters and 50 UTF-8 bytes. Appending ! produces 49 characters but 51 bytes, which the current validator rejects:
bip-0450.mediawiki has too-long Title (51 > 50 char max)
Decode UTF-8 only for the length check. Use FB_CROAK to reject malformed UTF-8 and LEAVE_SRC to preserve the original title bytes for table output.
Add regression tests for both MediaWiki and Markdown preambles, covering ASCII and UTF-8 length boundaries, the BIP 450 example, malformed UTF-8, and preservation of output bytes. Run these tests in the existing Build-Table-Checks job.
Validation:
prove scripts/buildtable.t— all 24 subtests pass.perl -c scripts/buildtable.plscripts/link-format-chk.shscripts/diffcheck.shtypos- Generated table output and diagnostics for all existing BIPs are byte-for-byte identical before and after the change.