unicode-rs / unicode-normalization

Unicode Normalization forms according to UAX#15 rules
https://unicode-rs.github.io/unicode-normalization
Other
160 stars 42 forks source link

impl UnicodeNormalization for char [enhancement] #75

Closed BartMassey closed 3 years ago

BartMassey commented 3 years ago

As far as I can tell, right now the only way to get a char normalized is to convert it into a String first, then "iterate" over it. This is a bit awkward and inefficient. It would be nice to have UnicodeNormalization implemented for char.

The UnicodeNormalization trait looks fine for this: you still need to produce an iterator because a single char might normalize to multiple chars.

The project looks big enough that I'm not going to try a pull request myself without some feedback. It looks like the normalize module provides the necessary functions, so I guess it's mostly just typing it in?

Manishearth commented 3 years ago

I think this would be fine

BartMassey commented 3 years ago

Thank you @Manishearth !! I kept meaning to get back to this, but never did. Really appreciate your picking it up.