I have this php function:
function upload_file($f,$fn){
switch($f['type']){
case 'image/jpeg':$image = imagecreatefromjpeg($f['tmp_name']);break;
case 'image/png':case 'image/x-png':move_uploaded_file($f['tmp_name'],'../images/pc/'.$fn.'.png');break;
case 'image/pjpeg':$image = imagecreatefromjpeg($f['tmp_name']);break;
echo $f['type'],'<br />';
}
if(!empty($image)) imagejpeg($image,'../images/pc/'.$fn.'.png');
}
where $fn = "нова-категория" but when I upload the renamed file to server - the image name is broken and looks like this: РЅРѕРІР°-категория.png
The interesting thing is that if I try to visit the image on server: site.com/images/pc/нова-категория.png => I can see the image.. Can you give me an idea what brakes the image name to look normal?