step-examples/12-1a-encoding/Le017.stp
Sources
- N014/ISO 10303-21 Ed.3 §6.4.3.4
- A029/lexer CR/LF pitfall
- R053/OCCT bug 33815
- W031/CAD Exchanger CHANGES v3.24.13
Description
Control characters (tab, LF, CR, NUL, etc.) must be encoded as `\X\hh` (e.g. tab = `\X\09`); raw bytes in a string literal are illegal even under the Ed.3 UTF-8 default. Files written by tools using "binary write" of attribute strings often contain raw `\t`, `\n`, or `\0`. Some parsers tolerate raw `\n` and then index past the line buffer when computing line/column for diagnostics. Round-tripping names with quotes, backslashes, and control chars must be preserved (per OCCT bug 33815).
Reproducer recipe
`'first line<RAW LF>second'`; `#1=PERSON('line1<RAW LF>line2');`
Expected kernel behavior
reject raw control characters in literals. Tolerant readers may translate raw `\n`/`\t` to space-equivalents and warn. Identifiers carrying control chars must round-trip without corruption when the user opted in.
Notes
**See also**: Le018, Le028. Synonyms: "raw tab in STEP string", "literal newline inside string", "raw control char inside literal", "NUL byte inside STEP string", "binary control byte unencoded in attribute". 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
matches(rb"'[^']*[\x00-\x08\x0b\x0c\x0e-\x1f][^']*'")matches(rb"'[^']*\t[^']*'")
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/* Le017: Raw control character (U+0000..U+001F) inside string body; ISO 10303-21 §6.4.3.4: control chars must be encoded as \X\HH; raw bytes including tab (\x09), vertical-tab (\x0B), form-feed (\x0C), and other C0 control bytes are spec-illegal in string literals; tools using binary-write mode copy raw control bytes into attribute strings; parsers tolerating raw \n may index past the line buffer computing line/col; receiver must reject or warn; must not silently produce wrong attribute value; GEOMETRIC_CURVE_SET IS model entity â OCC yields empty */ 3HEADER; 4FILE_DESCRIPTION(('Le017'),'2;1'); 5FILE_NAME('Le017.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('line1 line2','raw-tab-in-string',''); 12#8998=PERSON('line1line2','raw-vtab-in-string',''); 13 14ENDSEC; 15END-ISO-10303-21;