PHPWord_Shared_String.IsUTF8 returns FALSE for Cyrillic UTF-8 input
This commit is contained in:
Progi1984 2013-12-15 03:17:48 -08:00
commit e345d862b7
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}
/**