Please post all pre-sales questions of all products on this forum

Export with spanish characters

  • Dimitris Meimaris
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 7 months ago #35807 by Dimitris Meimaris
Export with spanish characters was created by Dimitris Meimaris
Hi, I tried the solutions in these two posts but I cound make the csv appear correctly in Excel. I see that the values are stored correctly in the database.

joomdonation.com/62-general-discussion/3...rt-registration.html
joomdonation.com/61-features-wish-list/3...ants-list.html#35482

Any suggestions please?

I edited the /MYSITE/components/com_eventbooking/controller.php

Please Log in or Create an account to join the conversation.

  • Dimitris Meimaris
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 7 months ago #35808 by Dimitris Meimaris
Replied by Dimitris Meimaris on topic Re: Export with spanish characters
Ok, I made it work, I edit the controller.php in the administrator folder.
I commented this line:
//header('Content-Type: ' . $mime_type);

I added these two lines right after that:
header('Content-Encoding: UTF-8');
header('Content-type: text/csv; charset=UTF-8');

and I echoed the BOM just before the print:
echo "\xEF\xBB\xBF";

My lines are:

...

ob_start(); //just for reference, I haven't changed anything before this
//header('Content-Type: ' . $mime_type);
header('Content-Encoding: UTF-8');
header('Content-type: text/csv; charset=UTF-8');
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');

if ($UserBrowser == 'IE') {

header('Content-Disposition: attachment; filename="' . $filename . '.csv"');

header('Cache-Control: must-revalidate, post-check=0, pre-check=0');

header('Pragma: public');

}

else {

header('Content-Disposition: attachment; filename="' . $filename . '.csv"');

header('Pragma: no-cache');

}
echo "\xEF\xBB\xBF";
print $csv_output;

exit();

....

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago #35911 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Export with spanish characters
Great. Thanks so much for sharing the solution :).

Tuan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham NgocGiang Dinh TruongMr. Dam