Completely solves the problem of incorrect Chinese file names in files uploaded by moodle. Thank you for choosing [8:19:00].
2 recommended
Moodle does not support Chinese well, which is a widely recognized bug. You can find some solutions on the Internet. The simplest solution is: --------------------------------- config. php.
$ Cfg-> unicodecleanfilename = true; ===================================================== 1.9 if you have tried this, you just need to change it. now
You can upload the document name in Normal Mode -------------------------- I also found such a description in lib/moodlelib. php. It turned out to be an official solution :/**
* Cleans a given filename by removing suspicious or troublesome characters
* Only these are allowed: alphanumeric _-.
* Unicode characters can be enabled by setting $ cfg-> unicodecleanfilename = true in config. php
*
* Warning: Unicode characters may not be compatible with zip compression in backup/restore,
* Because native zip binaries do weird character conversions. Use PHP zipping instead.
*
* @ Param string $ string file name
* @ Return string cleaned file name
*/In fact, this is not a thorough solution. If you select this site file when inserting a hyperlink, the Chinese file name in the returned file directory is garbled. However, I found that UTF-8 encoding can still be viewed correctly in the browser, but this is inconvenient after all. I can no longer find relevant information, so I am self-reliant. I found some PHP information and directly modified coursefiles. PHP file (LIB/Editor/htmlarea/coursefiles. PHP), add the following sentence to the second line: @ header ("Content-Type: text/html; charset = UTF-8"); test the webpage again, the browser can automatically select UTF-8 encoding without garbled characters. Finally, it completely solves the problem of garbled Chinese file names.