'OPTS UTF8 ON': command not understood

背景

go 操作 ftp , 使用 github.com/jlaffaye/ftp这个库
ftp server 是客户提供的,我们无法进行配置

问题复现

登录时报错,错误如题

解决方案

添加参数,禁用 utf8

ftp.Dial("ftp.example.com:21", ftp.DialWithTimeout(5*time.Second), ftp.DialWithDisabledUTF8(true))

原因

ftp Server 不支持 utf-8 编码, 泪目

原文地址:https://www.cnblogs.com/hanyanling/p/14823493.html