Open sffc opened 4 years ago
Also, instead of calling u_strToUTF8
, you should consider using the Rust standard library functions like std::str::encode_utf16. the conversion directly in Rust. You would avoid having to go across the FFI boundary when performing the conversion.
Hi @sffc thanks for looking at this code. I don't think Text
is used anywhere at the moment. It is mostly an artifact of me trying to understand the FFI binding methods, as I was learning rust at the same time that I was making the wrapper functions.
This is probably one of the first things that were wrapped once I got the low-level sys
stuff to build.
My question here is, where and how do you use the
Text
that you make? In ICU, a UText is primarily useful for interfacing with APIs like the BreakIterator and regex engine. It doesn't do a whole lot on its own, except maybe providing some more UTF-8 to UTF-16 conversions, but you already have that functionality inrust_icu_ustring
.