The main cause of the problem is that the encoding (UTF-8) code in fck is closely inconsistent with the local encoding (gbk, you can modify the following five files. Solve the problem of Chinese folder garbled characters: file 1: \ fckeditor \ editor \ fileman php fck folder and how to solve the problem of Chinese garbled characters when uploading images
The main cause is that the encoding (UTF-8) code in fck is closely inconsistent with the local encoding (gbk). the following five files can be modified.
Solve Chinese folder garbled characters:
File 1: \ fckeditor \ editor \ filemanager \ browser \ default \ browser.html
Find
OConnector. SendCommand = function (command, params, callBackFunction)
{
?????? Var sUrl = this. ConnectorUrl + 'command = '+ Command;
?????? SUrl + = '& Type =' + this. ResourceType;
//???? SUrl + = '& CurrentFolder =' + encodeURIComponent (this. CurrentFolder );
?????? SUrl + = '& CurrentFolder =' +? This. CurrentFolder ;?
?
?????? If (params) sUrl + = '&' + params;
?
?????? // Add a random salt to avoid getting a cached version of the command execution
?????? SUrl + = '& uuid =' + new Date (). getTime ();
?
?????? Var oXML = new FCKXml ();
?
?????? If (callBackFunction)
????????????? OXML. LoadUrl (sUrl, callBackFunction );?? // Asynchronous load.
?????? Else
????????????? Return oXML. LoadUrl (sUrl );
?
?????? Return null;
}
Remove the encodeURIComponent function.
?
File 2: \ fckeditor \ editor \ filemanager \ browser \ default \ frmcreatefolder.html
Find
Function CreateFolder ()
{
?????? Var sFolderName;
?
?????? While (true)
?????? {
????????????? SFolderName = prompt ('Type the name of the new folder :','');
?
????????????? If (sFolderName = null)
???????????????????? Return;
????????????? Else if (sFolderName. length = 0)
???????????????????? Alert ('Please type the folder name ');
????????????? Else
???????????????????? Break;
?????? }
?
//???? OConnector. SendCommand ('createfolder', 'newfoldername = '+ encodeURIComponent (sFolderName), CreateFolderCallBack );
?????? OConnector. SendCommand ('createfolder', 'newfoldername = '+ sFolderName, CreateFolderCallBack );
}
Remove the encodeURIComponent function.
?
File 3: \ fckeditor \ editor \ filemanager \ browser \ default \ frmresourceslist.html
Find
Function OpenFile (fileUrl)
{
//???? Window. top. opener. SetUrl (encodeURI (fileUrl). replace ('#', '% 23 '));
?????? Window. top. opener. SetUrl (fileUrl );
?????? Window. top. close ();
?????? Window. top. opener. focus ();
}
Remove the encodeURI function.
?
Solve the problem of garbled Chinese file names for uploaded images:
File 4: \ fckeditor \ editor \ filemanager \ connectors \ php \ commands. php
Find
Function FileUpload ($ resourceType, $ currentFolder, $ sCommand ){
...
? ??? Find
? ??? // Move_uploaded_file ($ oFile ['tmp _ name'], $ sFilePath );
Move_uploaded_file ($ oFile ['tmp _ name'], iconv ("UTF-8", "gbk", $ sFilePath ));
}
Transcode the file name $ sFilePath.
?
File 5: \ fckeditor \ editor \ filemanager \ connectors \ php \ util. php
Find
Function ConvertToXmlAttribute ($ value ){
?????? ...
?????? Find
????? // Return (utf8_encode (htmlspecialchars ($ value )));
?????? Return iconv ("GBK", "UTF-8", htmlspecialchars ($ value ));
}
Transcode the content.
?
The original I mentioned related problems in the blog: http://simpledev.iteye.com/blog/371619
(For details, refer to: directly overwrite files with attachments)
Sorting 120521
?