Skip to content

Commit 44e0a17

Browse files
authored
Merge pull request #42 from Joe91/master
Support of UTF-8
2 parents 0b8afab + 3e29f87 commit 44e0a17

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/FTPConnection.cpp

+9-3
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,11 @@ bool FTPConnection::readUntilLineEnd() {
7171
while (_Client.available()) {
7272
char c = _Client.read();
7373
if (c == '\n') {
74-
_LineSplited = Split<std::vector<String>>(_Line, ' ');
74+
uint32_t index_separator = _Line.indexOf(' ');
75+
_LineSplited = {_Line.substring(0, index_separator), _Line.substring(index_separator + 1, _Line.length())};
7576
return true;
7677
}
77-
if (c >= 32 && c < 127) {
78+
if (c >= 32) {
7879
_Line += c;
7980
}
8081
}
@@ -110,7 +111,11 @@ bool FTPConnection::handle() {
110111
/** Additional commads begin ************************************* by Akoro */
111112
else if (command == "OPTS") // need for Win10 ftp
112113
{
113-
_Client.println("500 not implemented");
114+
if (_LineSplited[1] == "UTF8 ON") {
115+
_Client.println("200 Ok");
116+
} else {
117+
_Client.println("500 not implemented");
118+
}
114119
_Line = "";
115120
return true;
116121
} else if (command == "NOOP") {
@@ -119,6 +124,7 @@ bool FTPConnection::handle() {
119124
return true;
120125
} else if (command == "FEAT") {
121126
_Client.println("211- Extensions suported:");
127+
_Client.println(" UTF8");
122128
_Client.println(" MLSD");
123129
_Client.println("211 End.");
124130
_Line = "";

0 commit comments

Comments
 (0)