file charset encoding problem?!?
Posted: Thu Sep 25, 2008 3:45 pm
i'm from turkey and special chars avaible in our alphabet like ?,?,?,?,ü,?,?,ç,Ç. i writing a code like that;
this is working. file is writing but file encoding with ANSI. if i change <body>Test</body> to like <body>??ü?iü??</body> file encoding with UTF-8. i want to file encoding UTF-8 always. but if code has not a special char like ?,? bla.. bla.. file encoding with ANSI. i don't want to add special chars just for this. how to handle to this problem?
*Sorry for my bad english
Code: Select all
<?php
$html='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body>Test</body></html>';
$open=fopen('yaz.php', 'wb+');
$write=fwrite($open, $html);
?>*Sorry for my bad english