So , i think you already have this issue since you reached this page , or you are simply browsing through the blog pages , either way here is the fix :

 

<?php	

  define('ABPATH', dirname(__file__) . '/'); //do not modify this

  $fp = fopen(ABPATH."writeto.txt", "a+");

  # Now UTF-8 - Add byte order mark 
  fwrite($fp, pack("CCC",0xef,0xbb,0xbf)); 

  fwrite($fp, "Text to be encoded goes here make sure you place those 'chinese' , 'strange chars' \n");
  
  fclose($fp);

?>

 

Keep it real ,
Best Regards ,Alin Razvan
I'm a small fish in a big ocean , trying to make a difference and some waves while swimming my way through .