Le008 — `\S\X` (8-bit shift) directive: misuse, chaining, or apostrophe-after-`\S\`

§12.1a encoding/strings (sub-class: `\S\` directive)

P1 — silent data loss

silent-loss encoding

Sources

Description

`\S\x` adds 0x80 to the next single ASCII character `x` to address the upper half of the active ISO-8859 page. It is a one-character operator. Defects: parser closes the string when the byte after `\S\` is an apostrophe (`'\S\'`), treats the directive as multi-character (`\S\xy`), chains it (`\S\\S\E`), or recurses into nested directive parsing (`\S\\X\41`).

Reproducer recipe

`'abc\S\'def'` (the byte after `\S\` is an apostrophe — the string is seven characters, not closed early); `'caf\S\\S\i'` (illegal chaining).

Expected kernel behavior

Heal and accept per spec: `\S\` consumes exactly the byte after the second `\` literally; do not recurse, do not close the string on that byte. Treat `\S\\` as `\S\` followed by `\` only outside another directive.

Notes

Cross-oracle: pure-Python Part-21 validator rejects (reject(E_STRING_OPEN)); OCCT silently accepts (load is `empty`). OCC auto-heals a spec-level violation. Synonyms: "S directive followed by apostrophe closes string", "8-bit shift escape misuse", "chained S directives", "string truncated at backslash S apostrophe", "STEP string ends mid-escape". 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

Tier-3 assertions

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes (with defect highlighting)
1ISO-10303-21;
2/* Le008: \S\ 8-bit shift directive misuse: apostrophe-after-\S\ and illegal chaining; \S\x adds 0x80 to the next single ASCII byte to address upper ISO-8859 page; defect 1: 'abc\S\'def' — apostrophe after \S\ is the shift operand, not string end; a parser that closes the string on the apostrophe produces a 3-char string 'abc' instead of the correct 7-char string; defect 2: 'caf\S\\S\e' — chaining two \S\ directives is illegal; \S\ is a one-character operator; spec does not permit \S\\S\ as a compound; receiver must consume exactly one byte after \S\ and reject or warn on chaining; GEOMETRIC_CURVE_SET IS model entity — OCC yields empty */
3HEADER;
4FILE_DESCRIPTION(('Le008'),'2;1');
5FILE_NAME('Le008.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('abc\S\''def','apostrophe-after-S-shift','');
12#8999=PERSON('caf\S\\S\e','chained-S-shift-directives','');
13
14ENDSEC;
15END-ISO-10303-21;