shedokan Posted December 6, 2007 Share Posted December 6, 2007 is there a way to create a .inc utf-8 file? I tried but all I get is: ×××××××××××××× Quote Link to comment Share on other sites More sharing options...
effigy Posted December 6, 2007 Share Posted December 6, 2007 I think so. How are you creating and saving the file? Quote Link to comment Share on other sites More sharing options...
shedokan Posted December 6, 2007 Author Share Posted December 6, 2007 function writeGuide($id, $text){ $f = fopen($id.".inc", "wb"); $text = utf8_encode($text); $text = "\xEF\xBB\xBF".$text; fwrite($f, $text); fclose($f); } Quote Link to comment Share on other sites More sharing options...
shedokan Posted December 6, 2007 Author Share Posted December 6, 2007 please. Quote Link to comment Share on other sites More sharing options...
effigy Posted December 6, 2007 Share Posted December 6, 2007 What is being passed to the function? What's in $text after the encode? Quote Link to comment Share on other sites More sharing options...
shedokan Posted December 6, 2007 Author Share Posted December 6, 2007 $text is a utf-8 text Quote Link to comment Share on other sites More sharing options...
shedokan Posted December 7, 2007 Author Share Posted December 7, 2007 please. Quote Link to comment Share on other sites More sharing options...
~n[EO]n~ Posted December 7, 2007 Share Posted December 7, 2007 Try like this, keeping utf8_encode function inside fwrite parameter, not too sure <?php function writeGuide($id, $text) { $f = fopen($id.".inc", "wb"); $text = "\xEF\xBB\xBF".$text; fwrite($f, utf8_encode($text)); fclose($f); } ?> Quote Link to comment Share on other sites More sharing options...
shedokan Posted December 7, 2007 Author Share Posted December 7, 2007 nope now I just get different characters. Quote Link to comment Share on other sites More sharing options...
shedokan Posted December 7, 2007 Author Share Posted December 7, 2007 please. I know that almost all of you use fopen()! Quote Link to comment Share on other sites More sharing options...
shedokan Posted December 7, 2007 Author Share Posted December 7, 2007 *bump* Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.