mirror of
https://github.com/servo/servo.git
synced 2025-07-16 11:53:39 +01:00
embedding: cef_string_ascii_to_utf16()
This commit is contained in:
parent
bd5419418e
commit
0d21a68ee7
1 changed files with 8 additions and 0 deletions
|
@ -262,3 +262,11 @@ pub extern "C" fn cef_string_wide_to_utf8(src: *const wchar_t, src_len: size_t,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern "C" fn cef_string_ascii_to_utf16(src: *const u8, src_len: size_t, output: *mut cef_string_utf16_t) -> c_int {
|
||||||
|
slice_to_str(src, src_len as uint, |result| {
|
||||||
|
let conv = result.utf16_units().collect::<Vec<u16>>();
|
||||||
|
cef_string_utf16_set(conv.as_ptr(), conv.len() as size_t, output, 1)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue