Drupal + FCKeditor 解决上传文件乱码问题

1、修正上传中文文件时文件名乱码问题
在文件fckeditor/editor/filemanager/connectors/php/commands.php中查找:

$sFileName = $oFile['name'] ;

在后面添加一行:
$sFileName = iconv("utf-8","gbk",$sFileName);

2、修正文件列表时中文文件名显示乱码问题
在文件fckeditor/editor/filemanager/connectors/php/util.php中查找:

return ( utf8_encode( htmlspecialchars( $value ) ) ) ;

修改为:
return iconv('','utf-8',htmlspecialchars( $value ));

3、修正新建中文文件夹时的文件夹名乱码问题
在文件fckeditor/editor/filemanager/connectors/php/commands.php中查找:

$sNewFolderName = $_GET['NewFolderName'] ;

在后面添加一行:
$sNewFolderName = iconv("utf-8","gbk",$sNewFolderName);

1、2步解决上传中文文件出现乱码的问题,2、3步解决新建中文目录出现乱码的问题,第2步很关键额,因为它关系到显示文件列表跟目录列表。

389 ->

 
'#delta' => 150,

188
'#delta' => 150,

.node .content, .comment .content <css> :  + font-size: 15px;

应用模块:
1. FCKeditor
2. Taxonomy Multi Editor
3. GeSHi or BBCode 

Comments

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo].

More information about formatting options