@author Kore Nordmann <mail@kore-nordmann.de> @since Method available since Release 3.4.6
string $string:
string
public static function prepareString($string) {
return preg_replace_callback('/[\\x00-\\x04\\x0b\\x0c\\x0e-\\x1f\\x7f]/', function ($matches) {
return sprintf('&#x%02x;', ord($matches[0]));
}, htmlspecialchars(PHPUnit_Util_String::convertToUtf8($string), ENT_COMPAT, 'UTF-8'));
}