Page 1 of 1

A problem about the folder

Posted: 18 Feb 2021, 01:55
by steven52880
I find it dosn't list items corrently

In helpers.inc.php ,It has $file = basename($path);
But "basename" doesn't seem to work well in a foreign languageļ¼Œso I get a wrong list

I add "setlocale(LC_ALL, 'zh_CN.UTF8');" into index.php and it works on Chinese

Re: A problem about the folder

Posted: 18 Feb 2021, 03:16
by mjau-mjau
But is it solved now after setting locale? We use PHP basename() to get the name of the directory. As stated in their docs:
PHP basename() wrote:basename() is locale aware, so for it to see the correct basename with multibyte character paths, the matching locale must be set using the setlocale() function.
So if you are using folder names with multi-byte characters, and your server default locale is not set to UTF-8, you would have to setlocale() in PHP. I may have to see if there are any workarounds to make it future-proof for all character sets.