Re: Spreadsheet_Excel_Writer & utf-8
| From: | Markus Ernst | Date: | Mon, 02 Oct 2006 18:24:31 +0000 |
| Subject: | Re: Spreadsheet_Excel_Writer & utf-8 | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-25332@lists.php.net to get a copy of this message | ||
Craig Constantine schrieb:
--On October 2, 2006 4:25:57 PM +0200 Aljosa Mohorovic <aljosa@fakanana.com> wrote:Use the accept-charset attribute in the form tag of your web form in order to get user inputs as UTF-8 or whatever character encoding your application works with. As the OP stated to have properly set the character set for database and HTML (and PHP of course) I assume this is not the source of the problem. Actually I encountered the same when working with DataGrid's XLS renderer, which is using Spreadsheet_Excel_Writer. I did not find a solution and ended up dropping Excel export. UTF-8 support would definitely be a great improvement to the Excel writer! -- Markusi've tried Spreadsheet_Excel_Writer package and it works ok except for strings that contain not-ascii characters. data from mysql database is normally viewable on web (encodings are set properly for database and html) but when i put data in xls file characters are wrong (it's like utf-8 is presented in iso-8859-1 or something else). any idea why? tips how to solve this?From my experience it's actually not a bug in the package, but rather aproblem with different contexts inferring different character encoding. For example: I had a web form where (unbeknownst to me) users where typing accented characters into text input fields (on their Windows platforms.) These chars went into a sqlite db, then were later pulled out and sent straight to the web browser. Garbage characters appeared regardless of browser or platform viewing. When the same string was pulled from the DB, and put into a spreadsheet using the pacakge, the characters displayed correctly on the windows platforms...