2 ms·
Besides the historical context others have pointed out, I'm pretty sure most people looking for a string length want the number of bytes. The number of code poi
by bawolff 4y ago
Besides the historical context others have pointed out, I'm pretty sure most people looking for a string length want the number of bytes. The number of code points in a unicode string is almost never useful. At most you might want width rendered on a screen, but that has nothing to do with number of codepoints.
> You have the binary length (that is, up to 7 in the emoji example as it could store up to 7 bytes), or you have the canonical length (which is 1 because we have 1 visible emoji symbol).
These numbers aren't really accurate. It depends how you define a "single" emoiji, but there are some that are > 7 utf-8 bytes, and there are some that are > 1 code point. E.g. the rainbow flag is a single graphical symbol that is 14 bytes long and 4 code points
> Far as I know, Redis used binary collation while other DBMS will need user to determine a default collation, most likely Latin-1.
Latin1 is a charset not a collation.