pyftpdlib中文件亂碼

pyftpdlib內部使用utf8,而windows使用gbk,可以將pyftpdlib進行修改:

1、filesystems.py

AbstractedFS.format_list與AbstractedFS.format_list最後一行

yield line.encode('utf8', self.cmd_channel.unicode_errors)

utf8改爲gbk

 

2、handlers.py

FTPHandler.decode

return bytes.decode('utf8', self.unicode_errors)

utf8改爲gbk

 

https://github.com/giampaolo/pyftpdlib/issues/257

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章