Answer the question
In order to leave comments, you need to log in
How to transcode text when creating csv file?
From the order I take the values.
$arSelectFields = Array('ID','DATE_INSERT_FORMAT','USER_NAME','USER_EMAIL','PRICE','CURRENCY');
$interenc = mb_internal_encoding();
$db_sales = CSaleOrder::GetList(array("DATE_INSERT" => "ASC"), $arrFilterCurDate ,'','',$arSelectFields);
while ($ar_sales = $db_sales->Fetch())
{
$collections[$ar_sales['ID']] = $ar_sales;
}
and then transfer them to the created CSV file.
$interenc = mb_internal_encoding();
$inputenc = mb_convert_variables($interenc, "UTF-8,",$collections);
$fileWithPropsValue = '/upload/pai/collections.csv';
if(!
IO\Directory::createDirectory(Application::getDocumentRoot() . '/upload/pai/');
}
$file = new IO\File(Application::getDocumentRoot() . $fileWithPropsValue);
$file->putContents(''); // clear file
putDataToCSV(Application::getDocumentRoot().$fileWithPropsValue,$collections);
but in the toga the entire Cyrillic alphabet is Сергей
How could this be corrected or recoded?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question