Jump to content

SQL Manager - Encoding is not in UTF8 in CSV exported files


AsuPa
 Share

Recommended Posts

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 by AsuPa (see edit history)

Share this post


Link to post
Share on other sites

  • 2 years later...
  • 1 year later...

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? 

Share this post


Link to post
Share on other sites

  • 3 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More