Invalid encoding on file names in NC19

Post deleted. Post deleted.

I`m facing the same issue with External Storage that I have set in my Nextcloud.
My setup is:
OS: Raspbian GNU/Linux 10 (buster)
NC19
PHP 7.3.14
Database: Server version: 10.3.22-MariaDB-0+deb10u1 - Raspbian 10
Apache: Apache/2.4.38 (Raspbian)

I have already adjusted my database following the below instructions but the error still happening when running occ files:scan.

https://docs.nextcloud.com/server/15/admin_manual/configuration_database/mysql_4byte_support.html

$ sudo -u www-data php /var/www/nextcloud/occ files:scan --all
Starting scan for user 1 out of 1 (admin)
        Entry "/var/www/nextcloud/data/admin/files/Ciências.PDF" will not be accessible due to incompatible encoding
        Entry "/var/www/nextcloud/data/admin/files/História de Tenório.mp4" will not be accessible due to incompatible encoding

Hope someone have a solution to avoid this error.

Hello,
I’m facing the same error.
Looks like it has some problems with special characters. In my case are the german “ä”, “ö” and “ü” causing the error.

Regards

No problems here. I can even use emojis as file names. Maybe the database isn’t configured correctly?

Solution that worked for me :

open “<nextcloud_install_folder>/lib/private/legacy/OC_Util.php” and change line 1367 :

public static function normalizeUnicode($value) {

if (Normalizer::isNormalized($value)) {
....
}

BY :

public static function normalizeUnicode($value) {

return mb_convert_encoding($value,"UTF-8");

if (Normalizer::isNormalized($value)) {
....
}
5 Likes

it worked for me, thanks a lot! you saved my life!!!

Same problem today with Nextcloud server v 23.0.2.

Your fix made it work. At least no errors. Will have to double check everything when the scan is complete.

Same issue on NC 24.