pub fn safe_component(raw: &str) -> StringExpand description
Generate a filesystem-safe single path component from an external identifier.
Rules (applied on all platforms for cross-platform determinism):
- Replace
/,\,:,<,>,",|,?,*, ASCII control chars, NUL with_ - Avoid trailing space or dot
- Avoid Windows reserved device names (CON, PRN, AUX, NUL, COM1-9, LPT1-9)
- Truncate to 200 bytes