I'm running into some problems w/ UTF-8 encoding on a XML file. I'm getting some values from my db (that is all stored as UTF-8) and creating an XML file from it. I have tried a few different variations and am getting nowhere. My end goal is to have the text render correctly in Flash (instead of gettting the box characters). I know it's working correctly on the Flash side because if I save the same XML file w/ my text editor with UTF-8 encoding it renders correctly. Here's some code I'm using with some comments mixed in from different variations of my attempts.
Any ideas would be appreciated. Thanks.
$exporttext = "some text w/ special characters like ™";
$enctype = iconv_get_encoding($exporttext);
//$exporttext = iconv($enctype, "UTF-8", $exporttext);
$fh = fopen($myFile, 'w') or die("can't open file");