'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 编码, 泪目

posted @ 2021-05-28 18:33  寒菱  阅读(596)  评论(0编辑  收藏  举报