Why iconv is not working correctly?

Hi all. Here is the piece of code of the plugin to modx.
foreach ($rows as $row) {
 $row[0] = iconv('CP1251','UTF-8',$row[0]);
 $btn = "<a class="button show-form" data-flat="{$row[0]}:{$row[2]}:".number_format((int)$row[6], 0, " ,', ' ')." RUB:".(!empty($row[7])?number_format($row[7], 0, ',', ').' RUB':"-").">Text</a>";
 $out .= "";
 $out .= "{$row[0]}";
 $out .= "{$row[1]}";
 $out .= "{$row[2]}";
 $out .= "{$row[3]}";
 $out .= "{$row[4]}";
 $out .= "{$row[5]}";
 $out .= "<span class="".(!empty($row[7])?" strikethrough': ")."'>".number_format((int)$row[6], 0, ',', ' ')." RUB</span>";
 $out .= "".(!empty($row[7])?number_format($row[7], 0, ',', ' ').' RUB': "")."";
 $out .= "".(!empty($row[8])?iconv('CP1251','UTF-8',$row[8]): $btn)."";
 $out .= "";
 //echo "<pre>";print_r(iconv('CP1251','UTF-8',$row[8])); echo "</pre>";

}

For $row[8] iconv not working. Only works if the csv file before the desired Text to put the number.
June 26th 19 at 14:16
1 answer
June 26th 19 at 14:18
Solution
So, pass the text in one encoding, and specify a different ('CP1251').
To check lay out somewhere the php FILE test-case c ONE line
<?= iconv(...) ?>

Find more questions by tags IconvMODXPHP