[FIX] Excel UTF-8 Export problem with encoding

karpa

New Member
This post is more to show you my fix after spending some time trying to export as "excel CSV" with Greek Characters.

The requirement was to be able to export data from my list, that excel can open just with "double click".
The data are encoded to MySQL as "utf8 general ci" and most of them are Greek.

My settings in CSV options
CSV File format -> Excel CSV (this makes the delimeter to be ; )
File encoding -> UTF8

The fix to make excel read correctly the file was to set the BOM.
So open file "components/com_fabrik/models/csvexport.php" and around line 95 replace
This
$str = "";​
With this
$str = "\xEF\xBB\xBF";
Tested with office 2007

Thanks
 
Hi

Tried it but it doesn't work.
I have also UTF8 general ci with Greek characters and I did the test as you proposed with Excel 2007 but I don't get the Greek characters.
 
You need to set UTF8 in list "publishing/csv" (default for Excel is still UTF-16LE which doesn't display Greek with/without BOM).
 
Yes. Thanks a lot Troester!
I did it already..:)
I changed also the code in an app which uses F3.0.9 and worked also.
 
Just a small notice for everyone interested in this.
In order to work as expected, you need to have at least Excel 2007 with SP3 or a newer version of Excel.
I tested it with Excel 2007 wto SP3 and it didn't work.

If you have Excel 2003 (rare but possible) you need again SP3 and the ver. 11.8404.xxxx or newer.

All the above in Windows XP, 2007.

More research on this matter with *MS*
http://stackoverflow.com/questions/...-correctly-with-excel-on-both-mac-and-windows
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top