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

Add support for various ICU features #514

Open
thomasp85 opened this issue Jan 6, 2025 · 6 comments
Open

Add support for various ICU features #514

thomasp85 opened this issue Jan 6, 2025 · 6 comments

Comments

@thomasp85
Copy link

Thanks for your work on this. As I work extensively with text rendering I know how gnarly all of this is.

For my work on https://github.com/r-lib/textshaping I need access to a few ICU features that aren't currently exposed by stringi and I'd rather not have to link to ICU myself, so I was wondering if you were open to adding these to stringi?

I'm currently looking especially to get the script associated with a given unicode point, whether the glyph/character is considered full-width, as well as formatting numbers in different scripts (e.g. 45 -> 四十五).

Is such functionality something you'd consider adding?

@gagolews
Copy link
Owner

gagolews commented Jan 7, 2025

Naturally; can you identify/point out the ICU services that would be responsible for that?
Or come up with a prototype?

@gagolews
Copy link
Owner

gagolews commented Jan 7, 2025

Related feature proposals that I had for a very long time: #4, #5,

@thomasp85
Copy link
Author

For the numeral translation I think an interface to https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/classicu_1_1number_1_1SimpleNumberFormatter.html would be sufficient. It would be required to modify the locale to use a numbering system based on the users request (https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/classicu_1_1NumberingSystem.html)

For my other requests it seems very aligned with #4 and #5, basically getting access to various properties of the unicode code point.

I'd be happy to try and bash some rocks together and create a PR

@gagolews
Copy link
Owner

gagolews commented Jan 7, 2025

That'd be great, thanks.

@thomasp85
Copy link
Author

Do you know why devtools::load_all() fails with stringi, while it still builds fine the standard way? It is potentially a "me" problem but wondered if you had seen it before and knew of a fix. What I'm getting is:

> devtools::load_all()
ℹ Loading stringi
Error in `dyn.load()`:
! ICU init failed: U_FILE_ACCESS_ERROR

After everything compiles fine

@gagolews
Copy link
Owner

gagolews commented Jan 7, 2025

I've no idea...

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

2 participants