Export to MS-Excel : Arabic character problem

friends, I am developing one application using php/mysql. I have to export some of the datas from my databse to excel format. Everything works fine untill I use arabic characters. When there are arabic words in the databse, it goes funny characters.

The code I am using is…
http://www.appservnetwork.com/modules.php?name=News&file=article&sid=8

Please give a solution to this…

In Excel, are you using a unicode font? Try changing the font of the worksheet concerned to a font line Lucide Sans Unicode

Actually my problem is to export. I do not have a way to set up font styles. Only I can export raw datas.

What is the selected MySQL charset for the connection and on the server? What Collation are the database tables set to?

your old data inserted as Latin1 default … you can’t view it at all …

u must change ur DEFAULT CHARSET in Mysql to utf8

ex:
;
CREATE TABLE Tablename (
id int(11) NOT NULL auto_increment,
x varchar(50) default NULL,
xy varchar(50) default NULL,
xyz varchar(250) default NULL,
date timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (id)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

then in ur insert browser or whatever u must change the text to utf8 too

ex:

<?php
mysql_query(“set names utf8”);
.
.
?>

good luck :slight_smile: