Does anyone have good suggestions for displaying "max length exceeded" errors to a user when a single character doesn't equal one byte?
I'm at a loss for words, but I found a quote that's more eloquent:
If the buffer runs over by three bytes, what do you tell the user? Three bytes could be one, two, or three characters that the user needs to trim. Depending on which characters they trim, the result might still be too long. And recall that the user's perception of "a character" is probably closer to a grapheme or grapheme cluster than to a character. So they might delete too many characters without realizing it. Finally, if the buffer limit is small (like 10 or 20), some languages like Chinese will be severely restricted on the number of characters permitted.
A couple of constraints I'm under is that its a form-driven website and the underlying database columns sizes can't change (the quote-page suggests having a 40byte buffer and enforcing a 10character limit).