Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support of UTF-8 #42

Merged
merged 4 commits into from
Jul 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/FTPConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@ bool FTPConnection::readUntilLineEnd() {
while (_Client.available()) {
char c = _Client.read();
if (c == '\n') {
_LineSplited = Split<std::vector<String>>(_Line, ' ');
uint32_t index_separator = _Line.indexOf(' ');
_LineSplited = {_Line.substring(0, index_separator), _Line.substring(index_separator + 1, _Line.length())};
return true;
}
if (c >= 32 && c < 127) {
if (c >= 32) {
_Line += c;
}
}
Expand Down Expand Up @@ -110,7 +111,11 @@ bool FTPConnection::handle() {
/** Additional commads begin ************************************* by Akoro */
else if (command == "OPTS") // need for Win10 ftp
{
_Client.println("500 not implemented");
if (_LineSplited[1] == "UTF8 ON") {
_Client.println("200 Ok");
} else {
_Client.println("500 not implemented");
}
_Line = "";
return true;
} else if (command == "NOOP") {
Expand All @@ -119,6 +124,7 @@ bool FTPConnection::handle() {
return true;
} else if (command == "FEAT") {
_Client.println("211- Extensions suported:");
_Client.println(" UTF8");
_Client.println(" MLSD");
_Client.println("211 End.");
_Line = "";
Expand Down