title: How can I convert OsStr to &[u8]/Vec<u8> on Windows?
body: <p>I'm trying to persistent raw OS file names to storage, so I need to get the raw bytes of an <code>OsStr</code>. </p>
  
  <p>It seems possible to call <a href="https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html#tymethod.as_bytes" rel="noreferrer"><code>as_bytes()</code></a> on *nix platforms, but that isn't defined on MS Windows. </p>
  
  <p>Is there a portable way to convert <code>OsStr</code> to bytes?</p>