step-examples/12-1a-encoding/Le004.stp
Sources
- T005/step-file-parser grammar.py:67-77
- A011/control-directive class
- N004/ISO 10303-21 Ed.3 §6.4.3.3
- S003/SFA-User-Guide-v7
Description
`\X\HH` must consume exactly two upper-case hex digits to encode an 8-bit ISO-8859-* code point. Real files emit one digit (`\X\F`), three or more (`\X\FFA`), lowercase (`\X\e9`), non-hex (`\X\GG`), or interpose whitespace (`\X\E9 9`). A loose parser may walk past the directive boundary or accept malformed values.
Reproducer recipe
`'caf\X\e9'`, `'caf\X\009'`, `'caf\X\F'`, `'caf\X\E9 9'`
Expected kernel behavior
strict 2-digit consumption; emit `E_BAD_X_DIRECTIVE` with offset; tolerant readers may accept lowercase by case-folding but must reject odd or non-hex digit counts.
Notes
Synonyms: "X escape with bad hex digit count", "lowercase hex in backslash X escape", "single-digit X directive", "malformed character escape", "non-hex character after backslash X". Provenance tier: bytes-only — defect is context/metadata OCC does not read at BRep load; mutation-test verified oracle-invisible (2026-07-01).
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Provenance tier
bytes-only — defect not fully embodied in fixture bytes.
Byte assertions
contains(b'\\X\\e9')contains(b'\\X\\009')contains(b'\\X\\F')
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/* Le004: \X\ single-byte ISO-8859 escape with bad hex digit count or non-hex input; \X\HH must consume exactly two upper-case hex digits; defects: one digit (\X\F), three digits (\X\009), lowercase (\X\e9), non-hex (\X\GG), or whitespace interposed (\X\E9 9); strict parser emits E_BAD_X_DIRECTIVE; tolerant reader may accept lowercase by case-folding but must reject odd or non-hex digit counts; GEOMETRIC_CURVE_SET IS model entity â OCC yields empty */ 3HEADER; 4FILE_DESCRIPTION(('Le004'),'2;1'); 5FILE_NAME('Le004.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('caf\X\e9','lowercase-hex-x-escape',''); 12#8998=PERSON('caf\X\009','three-digit-x-escape',''); 13#8999=PERSON('caf\X\F','single-digit-x-escape',''); 14 15ENDSEC; 16END-ISO-10303-21;