Use ftp in rclone with filename encode by shift-jis/gbk

What is the problem you are having with rclone?

hello,i am try to make a remote to FTP, in windows10
but this ftp is using japanese character(encoding by shift-jis)in filename and path,
so when i use lsd and mount ,i get error like
Failed to create file system for "NEW-FTP:": NewFs: failed to make FTP connection to "bishoujo.moe:700": Send 'CLNT client_type' before enabling UTF8.
then, i try ssl port of this sever, i can lsd and mount it,but all filename not in english cant be read

What is your rclone version (output from rclone version)

rclone v1.57.0

Which cloud storage system are you using? (eg Google Drive)

FTP

The command you were trying to run (eg rclone copy /tmp remote:tmp)

lsd  mount

The rclone config contents with secrets removed.

Failed to create file system for "NEW-FTP:": NewFs: failed to make FTP connection to "bishoujo.moe:700": Send 'CLNT client_type' before enabling UTF8.

A log from the command with the -vv flag

Failed to create file system for "NEW-FTP:": NewFs: failed to make FTP connection to "bishoujo.moe:700": Send 'CLNT client_type' before enabling UTF8.

Can you run an rclone lsf ftpremote: -vv --dump bodies please, and post the result.

like this,

2021/11/16 22:30:47 DEBUG : rclone: Version "v1.57.0" starting with parameters ["C:\Program Files\Rclone\rclone.exe" "lsf" "MIKOCONNEW-FTP:" "-vv" "--dump" "bodies"]
2021/11/16 22:30:47 DEBUG : Creating backend with remote "MIKOCONNEW-FTP:"
2021/11/16 22:30:47 DEBUG : Using config file from "C:\Users\Administrator\.config\rclone\rclone.conf"
2021/11/16 22:30:47 DEBUG : ftp://bishoujo.moe:700: Connecting to FTP server
2021/11/16 22:30:48 DEBUG : FTP Rx: "220 Please enter your login name now."
2021/11/16 22:30:48 DEBUG : FTP Tx: "USER xxxxx"
2021/11/16 22:30:49 DEBUG : FTP Rx: "331 Password required for xxxxx"
2021/11/16 22:30:49 DEBUG : FTP Tx: PASS *****
2021/11/16 22:30:49 DEBUG : FTP Rx: "230 User xxxxx logged in."
2021/11/16 22:30:49 DEBUG : FTP Tx: "FEAT"
2021/11/16 22:30:49 DEBUG : FTP Rx: "211-Extensions supported:"
2021/11/16 22:30:49 DEBUG : FTP Rx: " SIZE"
2021/11/16 22:30:49 DEBUG : FTP Rx: " MDTM"
2021/11/16 22:30:49 DEBUG : FTP Rx: " MDTM YYYYMMDDHHMMSS filename"
2021/11/16 22:30:49 DEBUG : FTP Rx: " MFMT"
2021/11/16 22:30:49 DEBUG : FTP Rx: " LIST -laT"
2021/11/16 22:30:49 DEBUG : FTP Rx: " STAT -laT"
2021/11/16 22:30:49 DEBUG : FTP Rx: " MODE Z"
2021/11/16 22:30:49 DEBUG : FTP Rx: " MLST type*;lang*;size*;modify*;create*;UNIX.mode*;UNIX.owner*;UNIX.group*;WIN32.ea*"
2021/11/16 22:30:49 DEBUG : FTP Rx: " MLSD"
2021/11/16 22:30:49 DEBUG : FTP Rx: " REST STREAM"
2021/11/16 22:30:49 DEBUG : FTP Rx: " XCRC filename;start;end"
2021/11/16 22:30:49 DEBUG : FTP Rx: " XMD5 filename;start;end"
2021/11/16 22:30:49 DEBUG : FTP Rx: " TVFS"
2021/11/16 22:30:49 DEBUG : FTP Rx: " CLNT client_type"
2021/11/16 22:30:49 DEBUG : FTP Rx: " LANG EN;FR;JA;DE;IT;SV;ES;RU;ZH-TW;ZH-CN"
2021/11/16 22:30:49 DEBUG : FTP Rx: " UTF8"
2021/11/16 22:30:49 DEBUG : FTP Rx: " EPRT"
2021/11/16 22:30:49 DEBUG : FTP Rx: " EPSV"
2021/11/16 22:30:49 DEBUG : FTP Rx: "211 END"
2021/11/16 22:30:49 DEBUG : FTP Tx: "TYPE I"
2021/11/16 22:30:50 DEBUG : FTP Rx: "200 Type set to IMAGE."
2021/11/16 22:30:50 DEBUG : FTP Tx: "OPTS UTF8 ON"
2021/11/16 22:30:50 DEBUG : FTP Rx: "500 Send 'CLNT client_type' before enabling UTF8."
2021/11/16 22:30:50 DEBUG : FTP Tx: "QUIT"
2021/11/16 22:30:50 Failed to create file system for "MIKOCONNEW-FTP:": NewFs: failed to make FTP connection to "bishoujo.moe:700": Send 'CLNT client_type' before enabling UTF8.

1 Like

What this looks like is that the server is refusing the OPTS UTF8 ON command because we haven't sent a CLNT client_type request.

A bit of searching indicates that CLNT is a non standard extension to identify a client. Why the FTP server should require it before you can turn UTF8 on, I don't know.

The library we use for connecting to FTP doesn't support the CLNT extension. Apparently FileZilla sends it immediately before turning UTF8 on. Something to think about @ivandeex ?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.