-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
German Umlaut in "genre" makes scan fail #846
Comments
While I'm at it, the issue is related to the lowercase feature.
|
Thanks for the report. However, I couldn't reproduce the issue when I set genre of couple of tracks to "Flötenkonzert". Please specify the version of ownCloud or Nextcloud used, as well as the version of the Music app. |
Sure : Nextcloud 20.0.8 with music app 1.1.0. May I send you by mail a share link to 2 affected files ? (flac files) |
Please, do. Maybe the significant factor is actually something else than the "ö" character. You can find my email address from my github profile. |
Done, Have a look in your mailbox 🙂 |
Got it, thanks. But still, I couldn't reproduce the problem: Both files were scanned without issues and show up under the genre "Flötenkonzert" on the UI. |
Could it be related to the default encoding of the database (utf8mb4) and php default charset (Iso-8859-1) ? Which charset are you using? |
The encoding in my database tables is "utf8" and the PHP default character set is "UTF-8". I now tested changing the PHP default encoding to "iso-8859-1" but that made no difference. That's expected, because I believe that the Nextcloud core anyway overrides the character set setting to UTF-8. |
I confirm this is an issue with character encoding (I don't know why you do not reproduce on your setup though). $genre->setLowerName(\mb_strtolower($name ?? '',\mb_detect_encoding($name))); (and also in Artist.php line 80 for a similar issue in subsonic API) it works perfectly. (maybe some other places, but 1AM here: I'll check once I slept) Would you accept a PR with these modifications? |
Before making the code changes, I would like to understand the underlying concepts here if at all possible. I have been under the assumption that the internal character encoding used by PHP on all Nextcloud code should be UTF8, regardless of the PHP configuration. But if this does not hold, then there may potentially be other problems, too. One more question: does your php.ini contain any values for the keys |
I understand 🙂
I tried without and with these key with the same result. (However, there may be some hidden tricks with the php configuration, I'm on a mutualized hosting). |
Now I had some time to investigate this further, and I finally managed to reproduce the issue! I had two different test setups which acted a bit differently:
On setup 1, setting
However, the scanning was working fine regardless, and the scanned tracks were shown correctly on the web UI. On setup 2, settings I also found that the problem could be fixed by overriding the encoding within the code by calling @pchesneau Could you test if this fixes the problem for you, too? |
Sure ! I'll try as soon as I'm at my computer. I'll keep you updated. |
It is possible that the internal encoding used by PHP is something else than UTF-8, depending on settings given in php.ini. Still, the OC/NC database should always be in UTF-8 and the getID3 library returns UTF-8-encoded data by default. Hence, using internal encoding other than UTF-8 may lead to unexpected results in many places, especially when any of the PHP built-in functions `mb_*` are used. To avoid this, we now override the internal encoding to be UTF-8 in the constructor of the main application class. refs #846
@pchesneau So have you been able to verify this? |
Sorry for the late reply @paulijar, I've juste tested this fix on my NC instance. It works perfectly ! |
Great, thanks for the confirmation! I'll try to make a new release including this fix soon; maybe tomorrow or latest on Sunday. |
The fix for this problem has now been released in Music v1.2.0. |
I recently added new tracks in my music library. Since then music scan fails.
When scan is performed from command line, the following error is reported:
The actual value of genre for this track is "Flötenkonzert".
It looks like an issue around character encoding .
The text was updated successfully, but these errors were encountered: