We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1257b46 commit 5e90c06Copy full SHA for 5e90c06
src/PHPWord/Shared/String.php
@@ -141,13 +141,13 @@ public static function ControlCharacterPHP2OOXML($value = '') {
141
}
142
143
/**
144
- * Check if a string contains UTF8 data
+ * Check if a string contains UTF-8 data
145
*
146
* @param string $value
147
* @return boolean
148
*/
149
public static function IsUTF8($value = '') {
150
- return utf8_encode(utf8_decode($value)) === $value;
+ return $value === '' || preg_match('/^./su', $value) === 1;
151
152
153
0 commit comments