open-i18n / rust-unic

UNIC: Unicode and Internationalization Crates for Rust
https://crates.io/crates/unic
Other
234 stars 24 forks source link

Arabic text #242

Open fasihrana opened 5 years ago

fasihrana commented 5 years ago

Is there something that allows converting a string of individual Arabic characters to the proper joined form of Arabic text?

For example my name written in individual letters is: ف ص ی ح while the joined form is (if you view this in any modern browser): فصیح

behnam commented 5 years ago

Thanks for filing this, @fasihrana.

We have two crates in the plans regarding the Unicode Arabic Cursive Joining algorithm:

But, should mention that, the output of such algorithm won't be a new string, but a list of joining forms, per character.

I'm guessing what you need is actually to convert the string (plug the output of UACJ algorithm) to (deprecated) Presentation Form code-points. Is that so?

If yes, could you please elaborate on why you need it, so we can see what are the options (and API design) to provide such functionality in UNIC?

fasihrana commented 5 years ago

I don't know enough about the deprecation of Presentation Code Points. Though typing on a keyboard, I doubt you could get any of the joined forms whch is the issue I'm trying to resolve, to convert a keyboard typed word in a joining alphabet to be presented correctly.

What I'm guessing is that once I have the code points for joined alphabets, the presentation will become easier?

xclud commented 11 months ago

@fasihrana This package solves the Problem: https://crates.io/crates/bidi