Le031 — UTF-16 / UTF-32 BOM mistaken for an ASCII file

§12.1a encoding/strings (sub-class: BOM)

encoding

Sources

Description

A producer saves the file as UTF-16 LE/BE or UTF-32, prepending `FF FE`, `FE FF`, or `FF FE 00 00` / `00 00 FE FF`. A strict ASCII tokenizer then sees what looks like garbage immediately after the BOM. Distinct from Le001 because the entire file body is two/four-byte-encoded.

Reproducer recipe

file beginning `FF FE 49 00 53 00 4F 00 …` (UTF-16 LE encoding of `ISO…`).

Expected kernel behavior

detect the BOM at offset 0 and either transcode to UTF-8 internally with a warning or reject with `E_UTF16_BOM_UNSUPPORTED`. Never silently treat half-bytes as ASCII.

Notes

**See also**: Le001. Synonyms: "STEP file in UTF-16", "FF FE BOM in STEP", "UTF-32 STEP not recognised", "wide-encoded STEP fails to parse", "two-byte encoded STEP file rejected".

Expected validation

occt=reject/reject gmsh=reject ifc=reject

Byte assertions

Tier-3 assertions

Cross-references

Le001

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes
1ÿþ/* Le031 - UTF-16 LE BOM mistaken for an ASCII file. Defect: file begins with FF FE and the entire body is UTF-16 LE; a strict ASCII tokeniser sees what looks like garbage immediately after the BOM. The comment, magic line, header, and data are all encoded as UTF-16 LE. */
2ISO-10303-21;
3HEADER;
4FILE_DESCRIPTION(('Le031 - UTF-16 LE BOM mistaken for ASCII'),'2;1');
5FILE_NAME('Le031.stp','2026-04-26T00:00:00',('auto-generated'),(''),'auto-generated','','');
6FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }'));
7ENDSEC;
8DATA;
9#10=CARTESIAN_POINT('',(0.0,0.0,0.0));
10#11=DIRECTION('',(0.0,0.0,1.0));
11#12=DIRECTION('',(1.0,0.0,0.0));
12#13=AXIS2_PLACEMENT_3D('',#10,#11,#12);
13ENDSEC;
14END-ISO-10303-21;
15