Hello,
I have a big problem with turkish characters ("ıüğöçş"). I am designing a video sharing script. First of all, the script gets the latest video info from mysql and write it into playlist.xml, and then flash video player reads the data from xml and shows it. However there is a problem with php generated xml files. When i use notepad and save it,everything works fine, but when php creates the xml file, strange characters appear.
My;
MySQL charset: UTF-8 Unicode (utf8)
MySQL connection collation: utf8_unicode_ci
PHP Code is below;
//XML PLAYLIST START
$xml_playlist="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n";
$xml_playlist.="<FLV_PLAYLIST Refresh=\"40\" Sequence=\"order\">\r\n";
$xml_playlist.="\t<DESCRITPTION Name=\"Name\" Value=\"\" />\r\n";
$xml_playlist.="\t<DESCRITPTION Name=\"Rating\" Value=\"Puan:\" />\r\n";
$xml_playlist.="\t<DESCRITPTION Name=\"Authour\" Value=\"Kullancı:\" />\r\n";
$xml_playlist.="\t<DESCRITPTION Name=\"Views\" Value=\"İzlenme:\" />\r\n";
$sql="SELECT videos.video_id,videos.indexer,videos.title AS Name,videos.updated_rating AS Rating,videos.number_of_views AS Views,member_profile.user_name AS Author FROM videos LEFT JOIN videocomments ON videos.video_id=videocomments.video_id LEFT JOIN member_profile ON
videos.user_id=member_profile.user_id WHERE videos.approved='yes' AND videos.public_private = 'public' ORDER BY videos.indexer LIMIT 20";
$result=mysql_query($sql);
$num_rows=mysql_num_rows($result);
for($i=0;$i<$num_rows;$i++){
$row=mysql_fetch_array($result,MYSQL_ASSOC);
$video_id=$row['video_id'];
$name=$row['Name'];
$rating=$row['Rating'];
$views=$row['Views'];
$author=$row['Author'];
$indexer=$row['indexer'];
$xml_playlist.="\t<VIDEO Name=\"$name\" Authour=\"$author\" Rating=\"$rating\" Comments=\"$comments\" Views=\"$views\" Thumbnails=\"/uploads/thumbs/$video_id.jpg\" url=\"play.php?vid=$indexer\" target=\"_self\"/>\r\n";
}
$xml_playlist.="</FLV_PLAYLIST>";
//Writing the xml data in the playlist.xml
$file= fopen("playlist.xml", "w");
fwrite($file, $xml_playlist);
fclose($file);
Please help!!!
Thanks