LJ::text_length — returns both byte length and character length of a string. In a non-Unicode environment, this means byte length twice. In a Unicode environment, the function assumes that its argument is a valid UTF-8 string.
LJ::text_length
(text);
text. the string to measure
cgi-bin/ljlib.pl
a list of two values, (byte_length, char_length).