AsuPa Posted March 25, 2018 Share Posted March 25, 2018 (edited) Hello there, I had some with CSV export files and UTF8 encoding. - for the basic Orders/Customers/etc tabs, I solve the problem by adding this line in the AdminController.php file : 'export_precontent' => "\xEF\xBB\xBF", (was empty before "" ). It works fine in this case, but it stile a problem when it comes to SQL exports by using the SQL Manager. Notes: I use PrestaShop 1.6.1 I already select UTF8 in SQL Manager When I display my query in my browser, it's displayed correctly I found a solution by manually opening my CSV file with a notepad, adding random characters at the beginning (such "azerty"), saving the file, and then opening it with excel. Do you have any solution to directly open the CSV file with the right encoding from the SQL Manager? Thank you Edited March 25, 2018 by AsuPa (see edit history) Link to comment Share on other sites More sharing options...
w3bsolutions Posted May 5, 2020 Share Posted May 5, 2020 (edited) For anyone arriving here with the same issue, the following override will encode the export in UTF-8 with BOM (when selecting UTF-8 as encoding in the SQL Manager). Place it in /override/controllers/admin/ AdminRequestSqlController.php Edited May 26, 2021 by w3bsolutions fix typo (see edit history) 1 Link to comment Share on other sites More sharing options...
nik Posted September 9, 2021 Share Posted September 9, 2021 Hi @w3bsolutions I tried your solution on Prstashop 1.7.6, but it did not work. The generateExport() has been replaced with processExport(), but the relevant code is still the same. But the outcome is the same: The UTF-8 encoding of characters other than Latin (e.g. Greek) looks correct on a notepad, but incorrect when opening the csv file with Excel. Any further ideas? 1 Link to comment Share on other sites More sharing options...
bibob Posted December 11, 2021 Share Posted December 11, 2021 prestashop 1.6 working thanks Link to comment Share on other sites More sharing options...
ZiedDams Posted September 27, 2022 Share Posted September 27, 2022 On 9/9/2021 at 10:40 AM, nik said: Hi @w3bsolutions I tried your solution on Prstashop 1.7.6, but it did not work. The generateExport() has been replaced with processExport(), but the relevant code is still the same. But the outcome is the same: The UTF-8 encoding of characters other than Latin (e.g. Greek) looks correct on a notepad, but incorrect when opening the csv file with Excel. Any further ideas? any news sir ? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now