I am creating a file using php fwrite() and I know all my data is in UTF8 ( I have done extensive testing on this - when saving data to db and outputting on normal webpage a
$handle = fopen($file,"w"); fwrite($handle, pack("CCC",0xef,0xbb,0xbf)); fwrite($handle,$file); fclose($handle);