• Hello,

    First of all, AWESOME JOB with NextGEN Gallery!! It saved me a lot of time. However, as a Chinese user, I ran into some problems.

    I need to import some images whose filenames are in UTF-8 from a folder. (The folder name is in English)
    I tried to do so, and NextGEN gallery did add a new gallery, but there were no images in it. (All images in that folder has Chinese filenames)

    Is UTF-8 filenames currently not supported, or am I just missing some configurations?
    If it’s not supported, I wish there could be such a feature in the next release.

    Thank you very much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter pellaeon

    (@pellaeon)

    I think I have solved this problem, but I’m not sure if this solution will cause other ploblems.

    Open admin/functions.php in your nextgen-gallery directory, go to line 233 (inside function scandir( $dirname = '.' )), change $files[] = utf8_encode( $file ); into $files[] = $file;.

    Hi,

    I have the same problem.
    BUT,
    When i try to use your solutions i find that the pictures that was imported to the gallery didnt have the correct name and there all kinds of weird problems in the thumbs.

    If you find another solution or this work for you please tell me

    Thread Starter pellaeon

    (@pellaeon)

    What was your original filename? Could you post some of them up here?

    I personally don’t have any problems with thumbnailing. So could you detail your problem?

    hi,

    the original file name was
    ???-1.jpg

    I changed the admin/functions.php and removes the “utf8_encode”.

    When i try to upload the file it is stuck on the thumbs creations.
    When i enter the gallery managment i cannot view the picture and cannot view the thumbs.

    Any clue how to fix that? i almost give up on this issue, and i realy don`t want to ??

    function scandir( $dirname = '.' ) {
    		$ext = array('jpeg', 'jpg', 'png', 'gif'); 
    
    		$files = array();
    		if( $handle = opendir( $dirname ) ) {
    			while( false !== ( $file = readdir( $handle ) ) ) {
    				$info = pathinfo( $file );
    				// just look for images with the correct extension
                    if ( isset($info['extension']) )
    				    if ( in_array( strtolower($info['extension']), $ext) )
    					   $files[] = $file; //  $files[] = utf8_encode( $file );
    			}
    			closedir( $handle );
    		}
    		sort( $files );
    		return ( $files );
    	}
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: NextGEN Gallery] UTF-8 filenames not recognized when importing image from folder’ is closed to new replies.