Phpckeditor solves the problem of garbled characters in the uploaded image file name. File name garbled characters are generally caused by Chinese characters, because ckeditor uses uft8 encoding. if we use gbk or gb2312 on the page, garbled characters may occur, the solution is generally caused by garbled characters in the uploaded file names, because ckeditor uses uft8 encoding. if we use gbk or gb2312 on the page, garbled characters may occur, the solution is to rename the uploaded file.
Open commands. php in the editor/filemanager/connectors/php directory and find the FileUpload function.
| The code is as follows: |
|
|
$ SExtension = substr ($ sFileName, (strrpos ($ sFileName, '.') + 1 ));
$ SExtension = strtolower ($ sExtension );
Add later
$ SFileName = rand (0,100). ".". $ sExtension; |
Here, the rand function can change the rename rules as needed.
Another solution is to use the iconv function to encode and convert the file name. However, there is still a problem of duplicate names. Therefore, it is best to rename the image file name uploaded by Fckeditor.
...