3 ms·
The author must have missed the part of the Unicode spec where it ascribes dozens of properties to code points: it assigns them a general category (e.g. control
by hgs3 4y ago
The author must have missed the part of the Unicode spec where it ascribes dozens of properties to code points: it assigns them a general category (e.g. control character, lower case letter, punctuation, and more), a case mapping (if applicable), a numeric value (if applicable) and the kind of number it is (ordinal or otherwise), the script they are typically written in, and many more.
I think the confusion with Unicode is that programmers apply their non-technical preconception of what a "character" is rather than understanding the Unicode definition. Unicode defines a character as a representation of something - maybe it represents a line break (control character), a letter, an ideographic, a combining mark, or something else. A "code point" is just a number that a character is assigned for numerical representation in memory. A "grapheme cluster" is what a user perceives as a character - it's how non-programmers see text. What needs to happen is programmers need to hammer in their heads the Unicode definition of "character" just like they relearned to count from zero.
- chrismorgan 4y agoYou’ve missed the point of the article, which is that optimising for code point indexing is silly. The author is well aware of all the properties you speak of, but they’re seldom things that end-developers should be touching directly, and none of them benefit from indexing by code point offset.