Use String.prototype.normalize
combined with Unicode property escapes
#146
wujekbogdan
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey,
First of all, thanks for the lib! It saved me a lot of headaches.
I've been trying to handle diacritics using the following solution:
It works pretty well, but it doesn't do exactly what
normalize-diacritics
does because it won't replaceł
withl
orđ
withd
, as it only handles diacritics.Still, it covers the vast majority of cases that
normalize-diacritics
handles using the hardcoded array of Unicode characters.So, the idea here is that the library code could be simplified by using the
String.prototype.normalize
API combined with Unicode property escapes to cover most cases and handling the remaining cases with the current lookup array.It could potentially also improve performance.
Beta Was this translation helpful? Give feedback.
All reactions