step-examples/12-1a-encoding/Le037.stp
Sources
- 16-iso-spec ISO 10303-21 Ed.3 §6.4.3 (`\PE\` alphabet extension)
Description
Edition-3 ISO 10303-21 defines `\PE\` as a single-letter alphabet selector that switches the active 96-glyph code page for subsequent characters until another `\PA\.\PI\` or `\PE\` directive resets it. A parser that recognises only the common `\PA\.\PI\` single-byte selectors and treats `\PE\` as an unrecognised escape will desynchronise its lexer or pass the directive through verbatim into the decoded string.
Reproducer recipe
`PRODUCT.name='greek=\PE\F\S\\S\xx-greek\PI\-end'` — switches to ISO-8859-7 (page F) for two `\S\xx` runs, then resets via `\PI\`. Receivers that drop the page selector decode the bytes against the default Latin-1 table and produce the wrong glyphs.
Expected kernel behavior
recognise `\PE\`, consume the selector letter, and decode subsequent bytes against the named code page until the next page-switch directive. If the page is unsupported, warn and fall back deterministically (e.g. default page) without lexer desynchronisation.
Notes
**See also**: Le030, Le012. Distinct from Le030 in that this entry exercises a mid-string page switch with a non-default page (Le030 covers the bare `\PE\` recognition only). Synonyms: "PE alphabet-extension directive ignored", "PE switches code page mid-string", "non-Latin code page selector", "STEP PE not implemented", "PE directive treated as literal".
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Byte assertions
contains(b'\\PE\\')count(b'\\PE\\') >= 2
Tier-3 assertions
shape_null == True
Cross-references
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1ISO-10303-21; 2/* Le037: \PE\ alphabet-extension directive switching to non-Latin code page mid-string; ISO 10303-21 Ed.3 §6.4.3: \PE\ followed by a letter (A-I) selects one of the nine ISO 8859 supplementary code pages for subsequent \S\x bytes; distinct from Le030: this entry exercises a mid-string page switch with page F (ISO-8859-7, Greek) via two \PE\F...\PE\A page-switch sequences; defect string: 'greek=\PE\F\S\\xE1-greek\PE\A\S\\x61-latin' â \PE\F switches to ISO-8859-7 (Greek), \S\\xE1 decodes to Greek α (U+03B1); then \PE\A switches back to ISO-8859-1 (Latin), \S\\x61 decodes to 'a'; parsers that only handle \PA\.\PI\ selectors ignore \PE\ entirely, producing wrong glyphs or raw directive bytes in the decoded string; receiver must recognise \PE\, consume the selector letter, and decode subsequent \S\ bytes against the named page; GEOMETRIC_CURVE_SET IS model entity â OCC yields empty */ 3HEADER; 4FILE_DESCRIPTION(('Le037'),'2;1'); 5FILE_NAME('Le037.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#8998=PERSON('greek=\PE\F\S\\xE1\PE\A\S\A','pe-page-switch-greek',''); 12#8999=PERSON('hebrew=\PE\G\S\\xE0\PI\-end','pe-page-switch-hebrew',''); 13 14ENDSEC; 15END-ISO-10303-21;