This article mainly introduces the pyftplib Chinese garbled problem solution, the article through the example code introduction is very detailed, for everyone’s study or work has a certain reference learning value, need friends can refer to
Using pyftpdlib to start the FTP server, FTP client when uploading files, if you do not specify the character code, if you encounter Chinese, it may be garbled; found a lot of information on the Internet, but their client is based on python. Still can’t solve my problem
So, we need to re code the method of ftphandler
def decode(self, bytes):
return bytes.decode('utf-8', self.unicode_errors)
Changing UTF-8 to GBK can solve the problem perfectly
The above is the whole content of this article, I hope to help you learn, and I hope you can support developer more.