step-examples/12-1a-encoding/Le009.stp
Sources
- Q066/StepData_StepReaderData.cxx:147-160
- T040/step-file-parser grammar.py:70
- A013/ISO control-directive class
- N008/ISO 10303-21 Ed.3 §6.4.3.2 Table 4
Description
`\PA\` through `\PI\` selects ISO-8859-1 through ISO-8859-9 (one upper-case letter, persistent for the rest of the string). Real files emit lowercase letters (`\Pg\`), digits (`\P1\`), full names (`\PISO\`), or omit/replace the selector (`\P\`, `\P!\`). Many parsers also skip the state machine and ignore the directive entirely, garbling subsequent characters.
Reproducer recipe
`'\PB\Krak\X\F3w'` (Polish "Kraków" via Latin-2); `'\Pg\\S\a'` (lowercase selector); `'\P1\…'` (digit); `'\P!\X\41'` (non-letter).
Expected kernel behavior
Reject `E_BAD_PAGE_DIRECTIVE` for out-of-range; validate `[A-I]` per Table 4; implement the page-state machine at minimum for `\PA\`; warn-and-accept (decoding may be incorrect when the state is not implemented).
Notes
Synonyms: "lowercase page selector", "P directive with digit selector", "Polish characters garbled in STEP", "page-shift state machine ignored", "PA through PI page directive bad". 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'\\Pg\\') or contains(b'\\P1\\') or contains(b'\\P!\\')count(b'\\P') >= 2
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/* Le009: \P{X}\ page-shift directive: bad selector and state-machine omission; \PA\ through \PI\ selects ISO-8859-1 through ISO-8859-9; defect 1: \Pg\ â lowercase selector 'g' is out of range (spec requires [A-I]); defect 2: \P1\ â digit selector '1' is invalid; defect 3: \P!\ â non-letter selector '!' is invalid; parsers ignoring the page-state machine decode subsequent characters against the wrong ISO-8859 page and produce wrong glyphs even when the entity is otherwise structurally valid; receiver must reject E_BAD_PAGE_DIRECTIVE for out-of-range selectors; GEOMETRIC_CURVE_SET IS model entity â OCC yields empty */ 3HEADER; 4FILE_DESCRIPTION(('Le009'),'2;1'); 5FILE_NAME('Le009.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('\Pg\Krak\X\F3w','lowercase-page-selector',''); 12#8998=PERSON('\P1\encoded-text','digit-page-selector',''); 13#8999=PERSON('\P!\\X\41','non-letter-page-selector',''); 14 15ENDSEC; 16END-ISO-10303-21;