Function
utfLen
Returns the length of a text in characters (not bytes). Important for non-ASCII letters: #"żółw" is 7 bytes, while utfLen("żółw") is 4.
Syntax
int utfLen(string input)Arguments
inputstring- The text.
Returns
Number of characters, or false for invalid UTF-8.
Example
addEventHandler("onPlayerChat", root, function(message)
if utfLen(message) > 120 then cancelEvent() outputChatBox("Za dluga wiadomosc", source) end
end)