file charset encoding problem?!?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hysteric
Forum Newbie
Posts: 3
Joined: Thu Sep 25, 2008 3:31 pm

file charset encoding problem?!?

Post by hysteric »

i'm from turkey and special chars avaible in our alphabet like ?,?,?,?,ü,?,?,ç,Ç. i writing a code like that;

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); 
 
?>
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 :D
Last edited by hysteric on Mon Sep 29, 2008 5:51 am, edited 3 times in total.
hysteric
Forum Newbie
Posts: 3
Joined: Thu Sep 25, 2008 3:31 pm

Re: file charset encoding problem?!?

Post by hysteric »

is anyone don't know? is problem in my english? is it much worst than that problem :D
at least write anything like your english sucks or dude, that problem is very tough.
Post Reply