Repository navigation
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
Uh oh!
There was an error while loading. Please reload this page.
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-diacriticsdoes because it won't replacełwithlorđwithd, as it only handles diacritics.Still, it covers the vast majority of cases that
normalize-diacriticshandles using the hardcoded array of Unicode characters.So, the idea here is that the library code could be simplified by using the
String.prototype.normalizeAPI 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.
All reactions