PHP: UTF-8 and Spreadsheet Excel Writer

Spreadsheet Excel Writer is a handy tool to generate MS Excel files with php. But it has some trouble handling utf-8 sources. Luckily Research e-Labs describes a simple solution:

After recently working on an application to generate Microsoft Excel documents using a PHP script, I ran into trouble with the PEAR package “Spreadsheet Excel Writer” which didn’t correctly display UTF-8 characters (Māori macrons in this case). Here is a fix!

2 Responses to “PHP: UTF-8 and Spreadsheet Excel Writer”

  1. Thank you so much, this was a great help.

  2. mb_convert_encoding($value, “UTF-8″,”ISO-8859-1″);
    worked for me

Leave a comment if you like: