Some shit with UTF-8 -> iconv and illegal character!

Topics: Developer Forum, Project Management Forum, User Forum
Dec 12, 2013 at 12:39 PM
First sorry for my english and maybe wrong forum.
I've try to save file but allways I got:
  • @version 1.7.8, 2012-10-12
    iconv_substr() [function.iconv-substr]: Detected an illegal character in input string in /home/s/php-excel/Classes/PHPExcel/Shared/String.php on line 576
    string here:
    return iconv_substr($pValue, $pStart, $pLength, 'UTF-8');
    Notice: iconv() [function.iconv]: Detected an illegal character in input string in /home/s/php-excel/Classes/PHPExcel/Shared/String.php on line 386
    string here:
    $value = @iconv('UTF-8', 'utf-8', $value);
BUT!!! Every data I write to file have
$data = @iconv('UTF-8', 'utf-8', $data);
Every string is 100% UTF-8!!!
Plz help!
Or help me save file with CP-1251!
Thanks
Dec 12, 2013 at 1:23 PM
What is supposed to be done by $data = iconv('utf-8', 'utf-8', $data)? without translit or ignore, I do not see the benefit...
The initial value contain what? If you have these errors, the character set is not that expected/assumed or one or several unrecognized characters are dragged into the stream, but between the scripts, records of a table, user input, a third-party file, the choice is vast. It is necessary that you restrict opportunities to identify the culprit.

And you have the right to specify what type of file you want to save :-)