step-examples/12-1a-encoding/Le036.stp
Sources
- W031/CAD Exchanger CHANGES v3.24.18
- G045/OCCT 475da0f
Description
A toolchain that decodes `\X2\…\X0\` into UTF-8 internally and re-encodes for export must round-trip the original Unicode characters. Several vendors lost backslashes (OCCT 7.5 regression) or replaced rare code points with `?` when the storage layer (XML, SQL VARCHAR(..)) silently truncated.
Reproducer recipe
PRODUCT name containing literal backslashes (`'C:\path\file'`) or rare CJK code points; export and re-import.
Expected kernel behavior
Heal and accept: preserve exact Unicode through encode/decode/storage; emit `\X2\…\X0\` only when the Ed.2 conformance class requires it. Must not silently lose Unicode content.
Notes
**See also**: Le022. Provenance tier: requires-sibling-pair; bytes alone cannot demonstrate round-trip loss; the defect is the differential between the input file and the writer's output. Demonstrating this requires both an `<id>.input.stp` fixture and the corrupted `<id>.stp` produced by re-export through the lossy XML/DB layer. Synonyms: "X2 content lost in XML round trip", "Unicode dropped through database layer", "VARCHAR truncates STEP Unicode", "STEP characters become question marks after DB store", "round-trip loses backslash X2 content". 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
requires-sibling-pair — defect not fully embodied in fixture bytes.
Byte assertions
contains(b'\\X4\\')contains(b'\\X2\\')contains(b'\\\\')
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/* Le036: Round-trip loss of \X2\ Unicode content through XML / DB storage layer; ISO 10303-21 §6.4.3.3: \X2\â¦\X0\ encodes UTF-16BE code units; OCCT 7.5 regression (commit 475da0f) dropped backslashes during re-export; SQL VARCHAR or XML attribute storage silently truncates rare CJK/SMP code points, replacing them with '?' or dropping bytes beyond the column width; this fixture represents the corrupted re-export: PRODUCT name originally carried backslash path 'C:\\path\\file' and rare SMP character via \X4\; corrupted output: backslashes lost, \X4\ supplementary plane character replaced with '?' â the re-exported file differs from the original content; kernel must preserve exact Unicode through encode/decode/storage cycles; heal and accept: do not silently lose Unicode content on round-trip; GEOMETRIC_CURVE_SET IS model entity â OCC yields empty */ 3HEADER; 4FILE_DESCRIPTION(('Le036'),'2;1'); 5FILE_NAME('Le036.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('C:\\\X2\4E2D\X0\path','x2-cjk-with-backslash',''); 12#8998=PERSON('\X4\0001F4C4\X0\','x4-supplementary-plane',''); 13#8999=PERSON('C:\\path\\file','literal-backslash-path',''); 14 15ENDSEC; 16END-ISO-10303-21;