IFClite TypeScript API
    Preparing search index...

    Function escapeStepString

    • Escape a string for STEP format.

      Backslash and single-quote are doubled per ISO-10303-21. Control characters (CR/LF and other C0 codes plus DEL) are \X2\00HH\X0\ directives, one per character, like every other character outside 32-126: the record stays on one line (no raw byte below 32 is written) and parseStepValue reads the character back. A space, which this wrote before, lost it.

      ISO 10303-21 6.3.3.4 restricts a literal's plain-text bytes to the "basic graphic" range 32-126; anything else is a control directive (\X\HH, \X2\HHHH\X0\, \X4\HHHHHHHH\X0), never a raw byte, and buildingSMART says the same for IFC2X3/IFC4/IFC4X3. A reader decoding as ISO-8859-1 (what the base standard and most consumers assume) turns raw UTF-8 into mojibake or a broken parse: IfcOpenShell#699/#1016, files rejected by Solibri. The one TS implementation (#3300); export re-exports it, a vector test pins Rust parity.

      Parameters

      • str: string

      Returns string