I have been through this earlier, and I spent a huge amount of time diagnosing sorting and what might be happening in a certain language. This was covered in this post:
https://forum.photo.gallery/viewtopic.php?f=66&t=10366#p48285
The menu_sort
and sort
may not be 100% consistent in Chinese, but that's because your system is inconsistent. For the file sorting, we use localeCompare() and it does not get any more correct than that. I don't know about mixed character sets on Chinese OS+server+browser, but I can't fix it if the implementation is correct.
For menu sorting, of course there are only options to sort by NAME or DATE. Date is easy of course, and for sorting by name, we use PHP natcasesort(). This is how your server believes they should be sorted, and if it's wrong (because of mixed chars or wrong encoding), that is not Files app's fault. This is the correct way to sort strings from PHP.
So the difference between the two, is that one sorts from server/PHP environment, while the other sorts from browser/Javascript environment. In most cases, they are identical, but on your system browser vs server, there are differences that Files app can't sort out for you. For the file sorting, we must use Javascript because it is dynamic and must be consistent on load as when re-sorting. For folders, we want to load and cache the correct order directly from server.
Basically, it's done correctly, so I'm not sure what else I can do.