Question

I have a weird issue with a php page. Here is the php

<?
    $fp = fopen('encoding.txt', 'a+');
    fwrite($fp, "côté");
    fclose($fp);
?>

When i try to view the txt file using a browser http://local.host/encoding.txt the result is :

côté

When i edit the source the result is :

côté

But when i download the file trough filezilla and edit it with textedit the result is :

côté

What did i missed ?

I already tried (did not change anything):

$fp = fopen('encoding.txt', 'a+');
fwrite($fp, utf8_encode("côté"));
fclose($fp);

Thanks for your help

Était-ce utile?

La solution

Make sure the file is saved as UTF-8 and the Browser use UTF-8 Encoding. Maybe that's enough.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top