Skip to main content

parse_bytes

Function parse_bytes 

Source
pub fn parse_bytes(bytes: &[u8]) -> Result<Graph, Error>
Expand description

Parse a Part 21 source given as raw bytes. Tries UTF-8 first; on failure falls back to ISO 8859-1 (Latin-1), which ISO 10303-21 §3.2 defines as the file format’s default encoding. Real-world STEP files frequently embed raw non-ASCII bytes (Cyrillic, Latin-1) directly instead of using the spec’s \X\ / \X2\ / \X4\ escapes — those bytes decode losslessly under the fallback (every byte 0x00..0xFF maps 1:1 to U+0000..U+00FF).

§Errors

Returns the first Error encountered by the underlying parser.