I have headers:
header('Content-Type: text/html; charset=UTF-8');
header("Content-type: application/octetstream");
header('Content-Disposition: attachment; filename="export.csv"');
but decoding not work correct if I have word in database "Pagrindinė"
in excel show "PagrindinÄ"
, what is wrong with my headers ?
What is wrong with my headers ?
Nothing, your headers are looking fine.
What is wrong with Excel?
The user who opens the file in Excel needs to tell Excel that the file is in UTF-8 encoding. Direct that user to contact the vendor of the software it uses for her/his support options.
Users of LibreOffice or a derivate of it do not have that problem btw., so one solution is to tell those to install a suite of such, open the CSV file and save it as Excel file for example.
Or you directly create the Excel file on your server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With