I have a text field in an interface and I have defined a character limit of 40. I need to be able to type both English and Greek characters in the field. When I write in Greek, the character limit count shows the double number of characters I actually type, so even if I type one character it shows 2/40. In English, it works properly. I think it is caused by the encoding, but I don’t know and can’t find any documentation on how to fix it. Is there a way to fix this problem? Maybe to configure the app so it reads all Unicode characters with UTF-8? Or is the problem somewhere else?
Discussion posts and replies are publicly visible
The characterLimit description reads "characterLimit (Number (Integer)): Determines the maximum number of characters. Depending on the language, some characters may count as more than one."
It looks like fn!len() might count the character lengths as 1 instead of 2, so your best bet may be to write your own character limit validation using fn!len() instead of using the built-in characterLimit parameter
Okay, great, thanks, I will try it!
That's interesting! Counting characters by the bytes they use is a problematic approach.
Peter Lewis, is that a known issue? I typed two Korean characters into a text field and it counted it as 6 characters. That's not exactly intuitive.
It is behaving as designed - since most limits are designed to limit the amount of data that can be written to the database, the character limit is designed to count multiple characters if the byte representation is higher.
Like Dan suggested, the best approach is to add a different validation if you want to validate differently.
Peter Lewis Thanks for sharing details. Its seems that fn!lenb function is used to check length. You can write your own custom validation using fn!len() function as mention by Stefan Helzle and Dan Lluhi
This applies to a!paragraphField as well.
I just looked up the documentation:
While the Appian platform itself is not affected by these limitations, the database can only store 255 bytes in a VARCHAR(255) field, and you could end up with space for only 63 actual characters.
Peter Lewis , what about the 4000 text length limitation in synced records, is this bytes or characters?
Yes, the same length considerations apply to the 4000 limit for a field in synced record types - it uses bytes and not true characters.
OK. Thanks a ton for this insight. And it makes me hoping even more for you lifting this limitation soon.