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 as toString, tend to return a malloc-allocated UCSChar strings. Though it's not necessarily in UCS as it follows the platform-specific wchar_t encoding.
  • free - Whether to free the ucs. Most strings returned by VTD-XML need being freeed.