step-examples/12-1a-encoding/Le005.stp
Sources
- Q065/StepData_StepReaderData.cxx:218-272
- Q067/StepData_StepReaderData.cxx:197-213
- S004/sfa-step.tcl:1198
- A010/ISO control-directive class
- T005, T038/step-file-parser
- N005/ISO 10303-21 Ed.3 §6.4.3.4
Description
`\X2\HHHH…\X0\` carries one or more 4-hex-digit UCS-2 code units; the hex run length must be a multiple of four. This entry encodes the 3-hex-digit-group flavor (`\X2\03B\X0\`).
Reproducer recipe
`#1=PERSON('\X2\03B\X0\');` — three hex digits between `\X2\` and `\X0\`.
Expected kernel behavior
validate group count and codepoint range; emit `E_BAD_X2_DIRECTIVE` on malformed input; warn-and-best-effort decode the chars present without crashing.
Notes
Crash potential when an out-of-range value is fed to a downstream UTF-8 encoder. Validation observed: silent-empty rather than the cited crash; the malformed string in PERSON.name does not reach the downstream UTF-8 encoder at fixture scale; the kernel-mishandling-by-silent-acceptance still demonstrates the defect class. **See also**: Le026, Le032, Le051, Le052, Le053. Synonyms: "X2 UCS-2 escape with three hex digits", "X2 hex group not multiple of four", "malformed Unicode escape in PERSON name", "X2 directive odd-length payload", "STEP Unicode escape rejects 3-digit group".
Expected validation
occt=empty/empty gmsh=empty ifc=schema_n/a
Byte assertions
contains(b'\\X2\\03B\\X0\\')
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/* Le005: \X2\ UCS-2 escape with 3-hex-digit group (not multiple of four); \X2\HHHHâ¦\X0\ requires hex digit count divisible by four (4 digits per UCS-2 code unit); \X2\03B\X0\ has only 3 digits â the group is malformed; receiver must validate group count; emit E_BAD_X2_DIRECTIVE on malformed input; warn-and-best-effort decode without crashing; crash potential when out-of-range value fed to downstream UTF-8 encoder; GEOMETRIC_CURVE_SET IS model entity â OCC yields empty */ 3HEADER; 4FILE_DESCRIPTION(('Le005'),'2;1'); 5FILE_NAME('Le005.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#8999=PERSON('\X2\03B\X0\','three-digit-ucs2-group',''); 12 13ENDSEC; 14END-ISO-10303-21;