Fixed: Non-ASCII chars caused the script to fail

escapeshellarg strips out non-ascii characters if the UTF8 is not explicitly set. This fix temporarily switches to UTF8 before calling escapeshellarg. I saw this bug when running the script under Apache - it didn't reproduce on the command line.