Page MenuHomePhabricator
Diviner libphutil Tech Docs phutil_is_utf8_slowly

function phutil_is_utf8_slowly($string, $only_bmp)
libphutil Technical Documentation (Core Utilities)

Determine if a string is valid UTF-8, slowly.

This works on any system, but has very poor performance.

You should call phutil_is_utf8() instead of this function, as that function can use more performant mechanisms if they are available on the system.

Parameters
string$stringSome string which may or may not be valid UTF-8.
bool$only_bmpTrue to require all characters be part of the basic multilingual plane (no more than 3-bytes long).
Return
boolTrue if the string is valid UTF-8.