embedding: cef_string_ascii_to_utf16()

This commit is contained in:
Mike Blumenkrantz 2014-11-17 19:32:02 -05:00
parent bd5419418e
commit 0d21a68ee7

View file

@ -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)
})
}