Creating XLS file (Greek Characters)
<p>I want to create a an XLS file with some info from the database and the data i want to retrieve from the database are all Greek characters.I have this code and when i execute the code i got only some symbols.Anyone knows what i have to change to get Greek characters properly?
Edit: The problem is both with the data that i retrieve from the Mysql Database and the headings
Here is the code</p>

<pre><code>$sql = "SELECT tmima,sex,surname,address,postcode,phone1,phone2 FROM student"; //the query
$result = $db-&gt;prepare($sql);
$result-&gt;execute();

$column = $result-&gt;columnCount();   
$header = "";

$head = array("Τμήμα","Φ","Επίθετο","Όνομα","Μητρώο"); //headings of the XLS

for($i = 0; $i &lt; $column;$i++ ){
    $header .= $head[$i]."\t";
}

$data = "";

while($row = $result-&gt;fetch(PDO::FETCH_ASSOC)/*mysql_fetch_row($rec)*/){
    $line = '';
    foreach($row as $value){

        if((!isset($value)) || ($value == " ")){
            $value = "\t";
        }else{
            $value = str_replace( '"' , '""' , $value );
            $value = '"' . $value . '"' . "\t";
        }//end of if-else

        $line .= $value;
    }//end of foreach

    $data .= trim( $line ) . "\n";

}//end of while($row = mysql_fetch_row($rec))


$data = str_replace("\r" , "" , $data);

if ($data == ""){
    $data = "\n No Record Found!\n";                       
}

header('Content-Description: File Transfer');
header('Content-Type: application/ms-excel; charset=utf8');
header("Content-Disposition: attachment; filename=Student_data.xls");
//header("Content-Transfer-Encoding: binary ");
header("Expires: 0");
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header("Pragma: public");

print "$header\n$data";
</code></pre>
