3 ms·
>> If the data is going to get printed in a monospace font, on a passport or credit card In the case of limited space, you absolutely can count characters and
by bruce511 3y ago
>> If the data is going to get printed in a monospace font, on a passport or credit card
In the case of limited space, you absolutely can count characters and limit them in the UI. For data storage though you would provision "enough bytes". Think approximately 4 bytes per character, plus a bit extra just in case.
But I agree in most cases the length limits are completely arbitrary and simply made up by the programmer at the time the database is designed. (Hint: They are _always_ too short, especially if the programmer lacks experience.)
- Dylan16807 3y ago> Think approximately 4 bytes per character, plus a bit extra just in case. I hope you don't have too much korean or compound emojis or some other things in that data, then. One of the unicode annexes needed to set a (partial) limit on code points in a single grapheme and the number it picked was 31.