Function vtd_xml::helpers::ucs2string
[−]
[src]
pub fn ucs2string<'a>(sbuf: &'a mut String,
ucs: *const UCSChar,
free: bool)
-> &'a mut String
Uses libiconv to decode a NIL-terminated wchar_t
string into a UTF-8 Rust string.
sbuf
- The buffer is cleared and filled with the decoded UTF-8 bytes.ucs
- VTD-XML functions, such astoString
, tend to return amalloc
-allocatedUCSChar
strings. Though it's not necessarily in UCS as it follows the platform-specificwchar_t
encoding.free
- Whether tofree
theucs
. Most strings returned by VTD-XML need beingfree
ed.