src/Mpdf.php
function is_utf8(&$string)
	{
		if ($string === mb_convert_encoding(mb_convert_encoding($string, "UTF-32", "UTF-8"), "UTF-8", "UTF-32")) {
			return true;
		}

		if ($this->ignore_invalid_utf8) {
			$string = mb_convert_encoding(mb_convert_encoding($string, "UTF-32", "UTF-8"), "UTF-8", "UTF-32");
			return true;
		}

		return false;
	}
function is_utf8(&$string)
	{
		if ($string === mb_convert_encoding(mb_convert_encoding($string, "UTF-32", "UTF-8"), "UTF-8", "UTF-32")) {
			return true;
		}

		if ($this->ignore_invalid_utf8) {
			$string = mb_convert_encoding(mb_convert_encoding($string, "UTF-32", "UTF-8"), "UTF-8", "UTF-32");
			return true;
		}

		return false;
	}
function is_utf8 ( & $ string ) { if ( $ string === mb_convert_encoding ( mb_convert_encoding ( $ string , "UTF-32" , "UTF-8" ) , "UTF-8" , "UTF-32" ) ) { return true ; } if ( $ this -> ignore_invalid_utf8 ) { $ string = mb_convert_encoding ( mb_convert_encoding ( $ string , "UTF-32" , "UTF-8" ) , "UTF-8" , "UTF-32" ) ; return true ; } return false ; }
Edited v1.2 Pass by reference; option to continue if invalid UTF-8 chars
Edited v1 . 2 Pass by reference ; option to continue if invalid UTF - 8 chars