Skip to content

Instantly share code, notes, and snippets.

@akizor
Created September 4, 2015 11:09
Show Gist options
  • Save akizor/2cc34595acdb9d3aa9e8 to your computer and use it in GitHub Desktop.
Save akizor/2cc34595acdb9d3aa9e8 to your computer and use it in GitHub Desktop.
MacOSX fix special characters (diacritics) in PHP export xls (excel) for Magento
$fileName = 'export-casete-plastica-' . Mage::getModel('core/date')->date('Y-m-d-h-i-s') . '.xls';
$content = mb_convert_encoding($content, 'UTF-16LE', 'UTF-8');
$this->_prepareDownloadResponse($fileName, chr(255) . chr(254) . $content);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment