3 ms·
> Rust cares about first-class FFI support; in particular, copying strings at FFI boundaries is right out. That is why Rust needs C strings to be a separate typ
by p0nce 11y ago
> Rust cares about first-class FFI support; in particular, copying strings at FFI boundaries is right out. That is why Rust needs C strings to be a separate type.
How does Rust handle strings encoded as UTF-16 or UTF-32? Does it need immediate conversion?
- fpoling 11y agoOsString [1] in Rust provides native string that can be directly passed to OS-specific API. It is UTF-16 on Windows. [1] - https://doc.rust-lang.org/std/ffi/struct.OsString.html https://doc.rust-lang.org/std/ffi/struct.OsString.html