2 ms·
Well, it's for human language, not only UI. If you are indexing it for search, pattern matching, or validating, you will want graphemes. But yes, computer lang
by marcosdumay 4y ago
Well, it's for human language, not only UI. If you are indexing it for search, pattern matching, or validating, you will want graphemes.
But yes, computer languages are normally designed so you can parse them at the byte view. Except for a small, but still surprising common set of them that are tokenized at the byte view, but parsed after some human language dependent transformation that happens over graphemes. (And those do usually have problem with internationalization.)
- josephg 4y agoIf your parsing code cares about grapheme cluster boundaries, it'll behave differently on the same string when the unicode spec changes. So it may work differently on different operating systems, or with different versions of your unicode libraries. And that means the output of your validation methods or tokenizers will randomly change! I'm happy for the rendering of strings to change over time. But in my business logic, compilers and database code: That sounds like an unnecessary source of bugs.