step-examples/12-1a-encoding/Le016.stp
Sources
- T008/step-file-parser fixtures `fail_reverse_string.ifc`, `pass_double_reverse.ifc`
- G045/OCCT 475da0f, Mantis 32310
- N012/ISO 10303-21 Ed.3 §6.4.3.1
Description
The reverse-solidus is the lead-in for Part-21 control directives; a literal backslash must be doubled (`\\`). Generators that copy Windows file paths verbatim emit single backslashes, which then accidentally form what looks like a malformed `\X\` or `\S\` directive (e.g. `\X1\`, `\Use…`).
Reproducer recipe
`'C:\path'` (rejected by spec); `'C:\Users\Test\X1\file.stp'` (the `\X1` resembles a malformed `\X\`); contrast with `'C:\\path'`.
Expected kernel behavior
strict mode rejects when the formed directive is malformed. Tolerant readers should detect un-escaped Windows paths and warn, treating unknown `\X` sequences as a literal character pair. Round-trip must preserve literal backslashes; OCCT 7.5.0 lost them for several releases.
Notes
Synonyms: "literal backslash from Windows path", "single backslash inside string", "C:\path forms accidental escape", "Windows file path escapes confused", "STEP string contains raw backslash".
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Byte assertions
matches(rb"'C:\\\\[A-Za-z]")count(b'C:\\') >= 1
Tier-3 assertions
shape_null == True
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1ISO-10303-21; 2/* Le016: Single backslash inside a string literal (Windows file path); ISO 10303-21 §6.4.3.1: reverse-solidus is the control-directive lead-in; a literal backslash must be doubled as \\\\; Windows path generators copy verbatim single backslashes into STEP strings; 'C:\\Users\\Test\\X1\\file.stp' â the \\X1 fragment resembles a malformed \\X\\ directive; strict mode must reject; tolerant readers must warn and must not silently consume following bytes as directive operands; round-trip must preserve literal backslashes (OCCT 7.5.0 lost them); GEOMETRIC_CURVE_SET IS model entity â OCC yields empty */ 3HEADER; 4FILE_DESCRIPTION(('Le016'),'2;1'); 5FILE_NAME('Le016.stp','2026-06-17T00:00:00',(''),(''),'cad-research-suite','',''); 6FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 7ENDSEC; 8DATA; 9#1=CARTESIAN_POINT('',(0.0,0.0,0.0)); 10#2=GEOMETRIC_CURVE_SET('',(#1)); 11#8997=PERSON('C:\path','windows-single-backslash',''); 12#8998=PERSON('C:\Users\Test\X1\file.stp','windows-x1-fragment',''); 13#8999=PERSON('C:\\good\\path','windows-doubled-backslash-correct',''); 14 15ENDSEC; 16END-ISO-10303-21;