Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the point of wrapping UText? #6

Open
sffc opened this issue Nov 14, 2019 · 2 comments
Open

What is the point of wrapping UText? #6

sffc opened this issue Nov 14, 2019 · 2 comments
Labels
discuss before start The issues isn't quite ready to be fixed, there are open questions to be discussed help wanted Extra attention is needed wontfix This will not be worked on

Comments

@sffc
Copy link

sffc commented Nov 14, 2019

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 in rust_icu_ustring.

@sffc
Copy link
Author

sffc commented Nov 14, 2019

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.

@filmil
Copy link
Member

filmil commented Nov 14, 2019

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.

@sffc sffc changed the title Feedback on rust_icu_utext What is the point of wrapping UText? Nov 16, 2019
@filmil filmil added the wontfix This will not be worked on label May 8, 2020
@filmil filmil added the help wanted Extra attention is needed label Aug 27, 2020
@filmil filmil added the discuss before start The issues isn't quite ready to be fixed, there are open questions to be discussed label Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss before start The issues isn't quite ready to be fixed, there are open questions to be discussed help wanted Extra attention is needed wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants