DEV Community

Discussion on: Quick and easy way of counting UTF-8 characters in Javascript

coolgoose profile image
Alexandru Bucur Author

Hi Gal,

That's really interesting, any idea why that might be the case ?

galdolber profile image
Gal Dolber

I think is because punctuation symbols are separate unicode characters that are collapsed into the first preceding non-Mark character.

Example: ד ָ דָ

So if you want to count the visible characters, you need to account for the marks.