step-examples/12-1c-syntax/Ls023.stp
Sources
- T001, A028, N001
Description
First non-whitespace token must be `ISO-10303-21;` (case-sensitive, hyphens, no leading whitespace, no BOM). Real files prepend UTF-8 BOM (`EF BB BF`), use lowercase, miss the trailing semicolon, double the hyphens (`ISO--10303-21`), or wrap in an XML envelope.
Reproducer recipe
`\xEF\xBB\xBFISO-10303-21;\nHEADER;..` or `iso-10303-21\nHEADER;..`
Expected kernel behavior
Strict reject; lenient strip UTF-8 BOM, uppercase-compare keyword, warn. Reject UTF-16/UTF-32 BOMs with clear error.
Notes
**See also**: Le001. Synonyms: "missing opening ISO-10303-21 line", "STEP file no magic header", "lowercase iso-10303-21", "double-hyphen in ISO-10303-21", "BOM before STEP magic".
Expected validation
occt=reject/reject gmsh=reject ifc=reject
Byte assertions
count(b'ISO-10303-21;') >= 1 or contains(b'iso-10303-21')matches(rb'iso-10303-21|ISO-10303-21')
Tier-3 assertions
load != "ok"
Cross-references
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1/* Ls023 - Missing or malformed opening magic line "ISO-10303-21;" 2 ---------------------------------------------------------------------- 3 Catalog section : §12.1c structural / framing 4 Sources : T001, A028, N001 5 Originally also catalogued as: Lh001 6 See also : Le001 7 ---------------------------------------------------------------------- 8 Defect 9 The first non-whitespace token must be "ISO-10303-21;" - case- 10 sensitive, hyphens, no leading whitespace, no BOM. Real files 11 prepend UTF-8 BOM (EF BB BF), use lower case, miss the trailing 12 semicolon, double the hyphens ("ISO--10303-21"), or wrap in an 13 XML envelope. 14 This file uses lower case AND omits the trailing ';'. 15 Expected behavior 16 Strict reject. Lenient mode strip UTF-8 BOM, uppercase-compare the 17 keyword, warn and continue. Reject UTF-16 / UTF-32 BOMs with a 18 clear "encoding not supported" error rather than truncating. 19 ---------------------------------------------------------------------- 20*/ 21iso-10303-21 22HEADER; 23FILE_DESCRIPTION(('Ls023 - malformed opening magic line'),'2;1'); 24FILE_NAME('Ls023.stp','2026-04-26T00:00:00',('auto-generated'),(''), 25 'auto-generated','',''); 26FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 27ENDSEC; 28DATA; 29#10=CARTESIAN_POINT('origin',(0.0,0.0,0.0)); 30#20=DIRECTION('x',(1.0,0.0,0.0)); 31#30=AXIS2_PLACEMENT_3D('placement',#10,#20,$); 32ENDSEC; 33END-ISO-10303-21;