step-examples/12-1a-encoding/Le044.stp
Sources
- 16-iso-spec ISO 10303-21 Ed.3 §6.4.3 (`\X2\.\X0\` 4-hex groups)
Description
`\X2\.\X0\` wraps 4-hex-digit groups each denoting one UCS-2 (BMP) scalar. Surrogate halves U+D800.U+DFFF are not BMP characters; they exist only as paired surrogates of UTF-16. A Java-vintage exporter that internally holds Java `char[]` (allowing lone surrogates) and writes them out one-by-one as `\X2\DXXX\X0\` produces a malformed but parseable token. A surrogate pair encoded as two `\X2\` groups (CESU-8-like) round-trips by accident on tools that decode UTF-16 surrogates.
Reproducer recipe
`'lone=\X2\D801\X0\'` — D801 is a high-surrogate half. `'pair=\X2\D801DC37\X0\'` — high+low surrogate pair.
Expected kernel behavior
reject lone surrogates with a precise diagnostic; either reject paired surrogates (strict) or transparently combine them into the matching supplementary-plane scalar (lenient, with a warning).
Notes
**See also**: Le006, Le041. Distinct from Le006 (which exercises hex run length, not surrogate semantics). Synonyms: "X2 payload contains UTF-16 surrogate halves", "Java char[] surrogate written as X2", "X2 with U+D800 surrogate", "lone surrogate in X2 hex run", "X2 surrogate-half value". 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'\\X2\\D801\\X0\\') or contains(b'\\X2\\D801DC37\\X0\\')count(b'\\X2\\') >= 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/* Le044: \X2\ payload containing UTF-16 surrogate halves; ISO 10303-21 Ed.3 §6.4.3: \X2\HHHH...\X0\ accepts 4-hex-digit groups each denoting one UCS-2 (BMP) scalar in the range U+0000-U+FFFF; surrogate halves U+D800-U+DFFF are not BMP scalars; they exist only as paired surrogates in the UTF-16 transformation format; defect string (lone): 'lone=\X2\D801\X0\' â D801 is a high-surrogate half; defect string (pair): 'pair=\X2\D801DC37\X0\' â high+low surrogate pair encoded as a single 8-digit \X2\ group (CESU-8-like); a Java-vintage exporter that internally stores Java char[] may emit lone surrogates one-by-one into \X2\ groups, producing malformed but parseable tokens; receiver must reject lone surrogates with a precise diagnostic; either reject paired surrogates (strict) or transparently combine them into the matching supplementary-plane scalar (lenient, with a warning); distinct from Le006: Le044 exercises surrogate semantics, not hex run length; GEOMETRIC_CURVE_SET IS model entity â OCC yields empty */ 3HEADER; 4FILE_DESCRIPTION(('Le044'),'2;1'); 5FILE_NAME('Le044.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('lone=\X2\D801\X0\','x2-lone-high-surrogate-D801',''); 12#8998=PERSON('pair=\X2\D801DC37\X0\','x2-surrogate-pair-D801DC37',''); 13#8999=PERSON('low=\X2\DC00\X0\','x2-lone-low-surrogate-DC00',''); 14 15ENDSEC; 16END-ISO-10303-21;