step-examples/12-1a-encoding/Le031.stp
Sources
- T001/step-file-parser #5 (related)
- A028/lexer pitfall
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
bytes_starts_with(b'\xff\xfe') or bytes_starts_with(b'\xfe\xff')length > 100
Tier-3 assertions
load != "ok"
Cross-references
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes
1ÿþ/ * L e 0 3 1 - U T F - 1 6 L E B O M m i s t a k e n f o r a n A S C I I f i l e . D e f e c t : f i l e b e g i n s w i t h F F F E a n d t h e e n t i r e b o d y i s U T F - 1 6 L E ; a s t r i c t A S C I I t o k e n i s e r s e e s w h a t l o o k s l i k e g a r b a g e i m m e d i a t e l y a f t e r t h e B O M . T h e c o m m e n t , m a g i c l i n e , h e a d e r , a n d d a t a a r e a l l e n c o d e d a s U T F - 1 6 L E . * / 2