diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-05-19 01:54:26 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-05-19 01:54:26 +0000 |
commit | f3233e12d81813b2574af831472fb4136066f8ee (patch) | |
tree | 73beae1df334b79cb4274fa607311e54046c6cd4 /bin | |
parent | d527e50395f3e76bbc6c76fcd4882dfbc88ff152 (diff) | |
download | ampache-f3233e12d81813b2574af831472fb4136066f8ee.tar.gz ampache-f3233e12d81813b2574af831472fb4136066f8ee.tar.bz2 ampache-f3233e12d81813b2574af831472fb4136066f8ee.zip |
sync to trunk
Diffstat (limited to 'bin')
-rw-r--r-- | bin/fix_filenames.inc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/fix_filenames.inc b/bin/fix_filenames.inc index cff22589..5f46f0e7 100644 --- a/bin/fix_filenames.inc +++ b/bin/fix_filenames.inc @@ -117,7 +117,14 @@ function charset_directory_correct($path) { $verify_filename = iconv(Config::get('site_charset'),Config::get('site_charset') . '//IGNORE',$full_file); if (strcmp($full_file,$verify_filename) != '0') { - $translated_filename = iconv($source_encoding,Config::get('site_charset') . '//IGNORE',$full_file); + $translated_filename = iconv($source_encoding,Config::get('site_charset') . '//TRANSLIT',$full_file); + + // Make sure the extension stayed the same + if (substr($translated_filename,strlen($translated_filename)-3,3) != substr($full_file,strlen($full_file)-3,3)) { + echo "Translation failure, stripping non-valid characters\n"; + $translated_filename = iconv($source_encoding,Config::get('site_charset') . '//IGNORE',$full_file); + } + echo "Attempting to Transcode to " . Config::get('site_charset') . "\n"; echo "--------------------------------------------------------------------------------------------\n"; echo "OLD:$full_file has invalid chars\nNEW:$translated_filename\n"; |