This question has already been answered:
- when working with substr () 1 answer
The abbreviation of the Russian text is incorrectly displayed, namely, after the abbreviation, the "question" symbol appears.
This question has already been answered:
The abbreviation of the Russian text is incorrectly displayed, namely, after the abbreviation, the "question" symbol appears.
A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .
The text is cut to length without considering the multi-byte encoding. Most likely your strings are stored in UTF-8, and cropping is done by length in bytes. As a result, the last character loses one or two bytes, and the placeholder symbol is displayed instead.
You should rewrite the trim function so that it takes into account multibyte characters, for example using the functions mb_substr() or iconv_substr()
See also:
Source: https://ru.stackoverflow.com/questions/706305/
All Articles