diff --git a/src/PHPWord/Shared/String.php b/src/PHPWord/Shared/String.php index 64309229..3dcdc80e 100644 --- a/src/PHPWord/Shared/String.php +++ b/src/PHPWord/Shared/String.php @@ -141,13 +141,13 @@ class PHPWord_Shared_String } /** - * Check if a string contains UTF8 data + * Check if a string contains UTF-8 data * * @param string $value * @return boolean */ public static function IsUTF8($value = '') { - return utf8_encode(utf8_decode($value)) === $value; + return $value === '' || preg_match('/^./su', $value) === 1; } /**