We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 564591a commit 96954c4Copy full SHA for 96954c4
1 file changed
native_api_1c_core/src/ffi/string_utils.rs
@@ -27,7 +27,7 @@ pub unsafe fn get_str<'a>(s: *const u16) -> &'a [u16] {
27
/// `Vec<u16>` - UTF-16 string without null terminator
28
#[cfg(target_family = "unix")]
29
pub fn os_string_nil(s: &str) -> Vec<u16> {
30
- s.encode_utf16().collect()
+ s.encode_utf16().chain(Some(0)).collect()
31
}
32
33
/// Helper function to convert Rust string to UTF-16 string
0 commit comments