Image upload - Latin chars problem
<p>I use this script to upload images to serveR:</p>

<pre><code> &lt;?php

if (($_FILES["image_upload_box"]["type"] == "image/jpeg" || $_FILES["image_upload_box"]["type"] == "image/pjpeg"  &amp;&amp; ($_FILES["image_upload_box"]["size"] &lt; 2000000))
    {

     $max_upload_width = 450;
     $max_upload_height = 450;
     if(isset($_REQUEST['max_width_box']) and $_REQUEST['max_width_box']!='' and $_REQUEST['max_width_box']&lt;=$max_upload_width){
      $max_upload_width = $_REQUEST['max_width_box'];
     }    
     if(isset($_REQUEST['max_height_box']) and $_REQUEST['max_height_box']!='' and $_REQUEST['max_height_box']&lt;=$max_upload_height){
      $max_upload_height = $_REQUEST['max_height_box'];
     } 
     if($_FILES["image_upload_box"]["type"] == "image/jpeg" || $_FILES["image_upload_box"]["type"] == "image/pjpeg"){ 
      $image_source = imagecreatefromjpeg($_FILES["image_upload_box"]["tmp_name"]);
     }  

     $remote_file =$directory."/".$_FILES["image_upload_box"]["name"];
     imagejpeg($image_source,$remote_file,100);
     chmod($remote_file,0644);

     list($image_width, $image_height) = getimagesize($remote_file);

     if($image_width&gt;$max_upload_width || $image_height &gt;$max_upload_height){
      $proportions = $image_width/$image_height;

      if($image_width&gt;$image_height){
       $new_width = $max_upload_width;
       $new_height = round($max_upload_width/$proportions);
      }  
      else{
       $new_height = $max_upload_height;
       $new_width = round($max_upload_height*$proportions);
      }  


      $new_image = imagecreatetruecolor($new_width , $new_height);
      $image_source = imagecreatefromjpeg($remote_file);

      imagecopyresampled($new_image, $image_source, 0, 0, 0, 0, $new_width, $new_height, $image_width, $image_height);
      imagejpeg($new_image,$remote_file,100);

      imagedestroy($new_image);
     }

     imagedestroy($image_source);



    }else{
       something....
    }

?&gt;
</code></pre>

<p>This is works well, till i upload a photo with latin chars in filename. 
For example the filename: kék hegyek.jpg. After upload file name will be: KĂ©k hegyek.jpg</p>

<p>How can i solve this?</p>

<p>Thank you</p>
