When mbstring.func_overload is in use for multi-byte encodings, the results from strlen() and similar functions respect the utf8 characters, causing binary data to return incorrect lengths.
This function overrides the mbstring encoding to a binary-safe encoding, and
resets it to the users expected encoding afterwards through the
It is safe to recursively call this function, however each
mbstring_binary_safe_encoding() call must be followed up with an equal number