File upload problem + fix

Omeka failed to upload files with non-ASCII characters in the filename. I got the "Something went wrong with image creation" error. Looked in Apache's error log and noticed that convert (ImageMagick) was given a filename with the non-ASCII characters stripped. Pinpointed the problem to application/libraries/Omeka/File/Derivative/Image.php, line 131:

$old_path = escapeshellarg( $old_path );

I realized that the real problem was that LC_CTYPE (or LC_ALL) wasn't set. I added the following to the top of admin/index.php, which fixed the problem:

setlocale(LC_CTYPE, "en_US.UTF-8");

This was on a default Ubuntu install. I imagine many others must have come across the same problem. Maybe it's a good idea to explicitly set this in PHP, like I did, or at least document it?

Otherwise, my experience with Omeka has been great. I'm going to use it for a couple of projects at work. Thanks for a fine piece of software!