PHPWord_Shared_String.IsUTF8 returns FALSE for Cyrillic UTF-8 input
This commit is contained in:
parent
1257b461b6
commit
5e90c066e8
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue