Answer the question
In order to leave comments, you need to log in
How to fix encoding when writing to csv file?
When writing to a csv file, the Russian text is written in krakozyabry.
How to fix?
$fp = fopen('importf.csv', 'w');
$list = array(
'Category,Brand,Product,Variant,SKU,Price,Old price,Currency ID,Weight,Stock,Units,Visible,Featured,Meta title,Meta keywords,Meta description,Annotation,Description,Images,URL, Производитель, Платформа',
$category.','.$brand.','.$name.', , ,'.$price.', ,2, , , ,1, ,'.$name.', , , , , ,'.$chp.",".$brand
);
foreach($list as $line)
{
fputcsv($fp, explode(',', $line), ";");
}
fclose($fp);
Answer the question
In order to leave comments, you need to log in
IW: I can't swear aloud...
1. Find out the encoding of the imported file
2. Convert or throw an error.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question