unicode_check

Github

unicode_check function perform checks about Unicode support in PHP, and set the right settings if needed.

convert_to_utf8

Github

convert_to_utf8 function convert data to UTF-8.
Requires the iconv, GNU recode or mbstring PHP extension.
Return converted data or FALSE.

truncate_bytes

Github

truncate_bytes function truncate a UTF-8-encoded string safely to a number of bytes.
If the end position is in the middle of a UTF-8 sequence, it scans backwards
until the beginning of the byte sequence.
Use this function whenever you want to chop off a string at an unsure
location. On the other hand, if you're sure that you're splitting on a
character boundary (e.g. after using strpos() or similar), you can safely use
substr() instead.
param $string - string to truncate.
param $len - an upper limit on the returned string length.
Return truncated string.