Hello, my collection includes Japanese music and sometimes non-latin characters in filenames. The playback never starts with these files.
I'm posting the data I managed to collect for a faulty file named "02 KEY - 夢の跡.flac". Database entry seems to be correct.
| id |
title |
album |
artist |
source_path |
path |
cover |
playtime |
track_number |
year |
disc |
band |
genre |
created |
modified |
| 1270 |
夢の跡 |
Kanon ORIGINAL SOUNDTRACK |
KEY |
/media/ssd/Music/Various Artists/Kanon ORIGINAL SOUNDTRACK/02 KEY - 夢の跡.flac |
/var/www/sonerezh/app/tmp/20170121103828.ogg |
4d4d19e3a972396f9c43f121d499ae6e.jpg |
2:09 |
2 |
2002 |
1/1 |
Various Artists |
Anime |
2017-01-21 10:21:25 |
2017-01-21 10:21:25 |
The problem appears to be in avconv conversion command. Here is what seems to be running (collected with ps aux | grep avconv), some characters are missing.
sh -c avconv -i '/media/ssd/Music/Various Artists/Kanon ORIGINAL SOUNDTRACK/02 KEY - .flac' -threads 4 -c:a libvorbis -q:a '8' '/var/www/sonerezh/app/tmp/20170121103828.ogg' 2>&1
I'm using PHP 5.6.29.
PHP 5.6.29-0+deb8u1 (cli) (built: Dec 17 2016 06:04:43)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
The foundamental issue might be with escapeshellarg function.
Someone suggested to setlocale(LC_CTYPE, "en_US.UTF-8") before calling escapeshellarg, but it didn't work for me. I also tried with other locales and the only one that worked was setlocale(LC_CTYPE, 'C.UTF-8') as suggested here.
Here are some tests on my installation.
<?php
$initialLocale = setlocale(LC_CTYPE, 0);
echo "Current Locale: " . setlocale(LC_CTYPE, 0) . "\n";
echo escapeshellarg("02 KEY - 夢の跡.flac") . "\n\n";
setlocale(LC_CTYPE, 'C.UTF-8');
echo "Current Locale: " . setlocale(LC_CTYPE, 0) . "\n";
echo escapeshellarg("02 KEY - 夢の跡.flac") . "\n\n";
setlocale(LC_CTYPE, $initialLocale);
echo "Current Locale: " . setlocale(LC_CTYPE, 0) . "\n";
echo escapeshellarg("02 KEY - 夢の跡.flac");
Current Locale: C
'02 KEY - .flac'
Current Locale: C.UTF-8
'02 KEY - 夢の跡.flac'
Current Locale: C
'02 KEY - .flac'
I patched my local installation with setlocale(LC_CTYPE, 'C.UTF-8'); before passthru($avconv…); calls in SongsController.php and it seems to have solved this problem in my situation. I guess all escapeshellarg should be patched and locale should be restored after each call. Or maybe there could be a better approach?
Thanks for this wonderful project and I hope to have been useful with this report.
Hello, my collection includes Japanese music and sometimes non-latin characters in filenames. The playback never starts with these files.
I'm posting the data I managed to collect for a faulty file named "02 KEY - 夢の跡.flac". Database entry seems to be correct.
The problem appears to be in avconv conversion command. Here is what seems to be running (collected with
ps aux | grep avconv), some characters are missing.I'm using PHP 5.6.29.
The foundamental issue might be with
escapeshellargfunction.Someone suggested to
setlocale(LC_CTYPE, "en_US.UTF-8")before callingescapeshellarg, but it didn't work for me. I also tried with other locales and the only one that worked wassetlocale(LC_CTYPE, 'C.UTF-8')as suggested here.Here are some tests on my installation.
I patched my local installation with
setlocale(LC_CTYPE, 'C.UTF-8');beforepassthru($avconv…);calls in SongsController.php and it seems to have solved this problem in my situation. I guess allescapeshellargshould be patched and locale should be restored after each call. Or maybe there could be a better approach?Thanks for this wonderful project and I hope to have been useful with this report.