I need to show first 50 charachters of the message as subject. I use this:
$subject = substr("$message", 0, 50);
It works correct with charachters like:
abcdefghjklt...
If message contains charachters of other languages, for example:
āēīūļķΕΎčņō...
the $subject will be not 50 charachters long. It will much shorter depending of the amount of "special" charachters
I know, it's utf-8 problem. Is there any solution how to fix this? The same problem I have using function which checks the lenght of words to prevent users typing large words without spaces like wwwwwwwwwwwwwwwwwwwwwwwww...
If I set max charachters in a word to 30 it works OK in English. In other languages it's not possible to enter even 15 charachters.
Thank you.