step-examples/12-1a-encoding/Le035.stp
Sources
- N003/ISO 10303-21 Ed.3 §6.4
- N007/§6.4.3.5
Description
An Ed.3 producer that retains Ed.2 codepaths emits `\S\`/`\P\`/`\X\` even though the body is UTF-8 by default. Strict Ed.3 readers that assume raw multi-byte UTF-8 may then double-decode (interpret `\X\C3 \X\A9` and the byte sequence `0xC3 0xA9` as two different characters when both were intended as `é`).
Reproducer recipe
file with `implementation_level='4'` (Ed.3) containing `'caf\X\E9'`; or `'caf\PA\\S\i'`.
Expected kernel behavior
Heal and accept both edition styles regardless of declared edition; never assume the file declares its encoding mode.
Notes
**See also**: Le021. Synonyms: "unnecessary X escapes in UTF-8 file", "Ed.2 escapes in Ed.3 STEP", "double-decoded UTF-8", "redundant control directives in modern STEP", "X escape in UTF-8 file double-decodes". Provenance tier: bytes-only (Q5 full-corpus 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\\') and matches(rb"'[^']*[\xc0-\xff][\x80-\xbf]")
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
1ISO-10303-21; 2/* Le035: Ed.2 encoding directives emitted in an Ed.3 UTF-8 file unnecessarily; ISO 10303-21 Ed.3 §6.4: the file body is UTF-8 by default when implementation_level is '4' or higher; Ed.3 producers that retain Ed.2 codepaths emit \X\E9 or \PA\\S\i even though the body is already UTF-8 â causing double-decode; strict Ed.3 reader interprets raw 0xC3 0xA9 as é AND also decodes \X\E9 as é, producing a doubled or corrupted glyph; heal and accept: receivers must not assume the file edition matches its header; defect 1: 'caf\X\E9' â \X\E9 is the Ed.2 escape for é (latin-1 0xE9) but also raw UTF-8 byte 0xE9 appears because the body is UTF-8; defect 2: 'caf\PA\\S\i' â \PA\ selects ISO-8859-1 then \S\i is 0xE9=é, again redundant in an Ed.3 UTF-8 body; GEOMETRIC_CURVE_SET IS model entity â OCC yields empty */ 3HEADER; 4FILE_DESCRIPTION(('Le035'),'4'); 5FILE_NAME('Le035.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é','raw-utf8-e-acute',''); 12#8998=PERSON('caf\X\E9','ed2-x-escape-in-ed3',''); 13#8999=PERSON('caf\PA\\S\i','ed2-pa-s-in-ed3',''); 14 15ENDSEC; 16END-ISO-10303-21;