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

Better support for &[u16] #250

Open
hsivonen opened this issue Jul 12, 2022 · 0 comments
Open

Better support for &[u16] #250

hsivonen opened this issue Jul 12, 2022 · 0 comments

Comments

@hsivonen
Copy link
Contributor

Currently in rust_icu, APIs that take read-only UTF-16 arguments take &UChar. This means that if the caller has UTF-16 in a different container, the user needs to do something to materialize a UChar container instead. Yet, the underlying C API might be taking UTF-16 by pointer and length.

On the other hand, when the output of an API is UChar, there doesn't appear to be a ready-made way to read its contents as &[u16].

I suggest 1) making UChar deref into &[u16] and 2) making APIs that take read-only UTF-16 arguments take &[u16] (which UChar can then deref to).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant