Page MenuHomePhabricator
Diviner libphutil Tech Docs phutil_is_utf8_with_only_bmp_characters

function phutil_is_utf8_with_only_bmp_characters($string)
libphutil Technical Documentation (Core Utilities)

Determine if a string is valid UTF-8, with only basic multilingual plane characters. This is particularly important because MySQL's utf8 column types silently truncate strings which contain characters outside of this set.

Parameters
string$stringString to test for being valid UTF-8 with only characters in the basic multilingual plane.
Return
boolTrue if the string is valid UTF-8 with only BMP characters.