Hallo,
Jetzt lasse ich php in meinem Skript mit fopen("test.php", "w") diese datei anlegen und stelle hinterher fest, die Datei ist nicht utf8-codiert.
na sowas aber auch. ;-)
Zunächst mal solltest du das Missverständnis über Bord werfen, die Codierung sei eine Eigenschaft der Datei. Nein, sie ist eine Eigenschaft des *Dateiinhalts*. Bei einer leeren Datei (0 Byte Länge), die keinen Inhalt hat, ist es demzufolge auch nicht sinnvoll, ihr eine bestimmte Codierung anzudichten.
was ist dafür verantwortlich, wie kan ich's ändern ?
Du als PHP-Programmierer bist dafür verantwortlich, und du kannst es ändern, indem du UTF-8-codierte Daten in die geöffnete Datei hineinschreibst.
So long,
Martin
--
Most experts agree: Any feature of a program that you can't turn off if you want to, is a bug.
Except with Microsoft, where it is just the other way round.
Most experts agree: Any feature of a program that you can't turn off if you want to, is a bug.
Except with Microsoft, where it is just the other way round.