Skip to content

Commit

Permalink
https://github.com/PHPOffice/PHPExcel/issues/265
Browse files Browse the repository at this point in the history
PHPExcel_Shared_String.IsUTF8 returns FALSE for Cyrillic UTF-8 input
  • Loading branch information
Roman Syroeshko authored and Roman Syroeshko committed Nov 8, 2013
1 parent f9f37f5 commit b21a509
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Classes/PHPExcel/Shared/String.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,13 +397,13 @@ public static function SanitizeUTF8($value)
}

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

/**
Expand Down

0 comments on commit b21a509

Please sign in to comment.