I've seen lots of places say:
The maximum number of characters is 255.
where characters are ASCII. Is there a technical reason for that?
EDIT: I know ASCII is represented by 8 bits and so there're 256 different characters. The question is why do they specify the maximum NUMBER of characters (with duplicates) is 255.
The Text field is one of the most generic and common data entry fields used to capture text type data—letters, numbers, and symbols. Text fields hold up to 255 characters in a single line.
The original 16-bit resource format represented strings as null-terminated sequences of bytes, so in theory they could have been arbitrarily large. However, 16-bit string resources were limited to 255 characters because they used a byte count for string length.
The ASCII character 255 is actually a non-breaking space, or NBSP!
Answer: 250 characters is between 35 words and 63 words with spaces included in the character count. If spaces are not included in the character count, then 250 characters is between 41 words and 84 words.
I assume the limit you're referring to is on the length of a string of ASCII characters.
The limit occurs due to an optimization technique where smaller strings are stored with the first byte holding the length of the string. Since a byte can only hold 256 different values, the maximum string length would be 255 since the first byte was reserved for storing the length.
Some older database systems and programming languages therefore had this restriction on their native string types.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With