Skip to content

Commit 5a5d7e7

Browse files
author
Salim Lachdhaf
committed
* fix bug [#43](#43)
1 parent 3a9c11e commit 5a5d7e7

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## [2.0.9] - 2024.08.29
2+
* fix bug [#43](https://github.com/salim-lachdhaf/dartFTP/issues/43)
13
## [2.0.7] - 2024.02.25
24
* fix bug [#18](https://github.com/salim-lachdhaf/dartFTP/issues/18) thnx @ChaseGuru
35
## [2.0.6] - 2024.02.25

lib/src/commands/directory.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'dart:async';
2+
import 'dart:convert';
23
import 'dart:io';
34
import 'dart:typed_data';
45

@@ -80,7 +81,7 @@ class FTPDirectory {
8081

8182
// Convert MLSD response into FTPEntry
8283
List<FTPEntry> lstFTPEntries = <FTPEntry>[];
83-
String.fromCharCodes(lstDirectoryListing).split('\n').forEach((line) {
84+
Utf8Codec().decode(lstDirectoryListing).split('\n').forEach((line) {
8485
if (line.trim().isNotEmpty) {
8586
lstFTPEntries.add(
8687
FTPEntry.parse(line.replaceAll('\r', ""), _socket.listCommand),

lib/src/ftp_socket.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class FTPSocket {
3434

3535
//this is used to read all data for specific command line
3636
while (_socket.available() > 0) {
37-
res.write(String.fromCharCodes(_socket.read()!).trim());
37+
res.write(Utf8Codec().decode(_socket.read()!).trim());
3838
dataReceivedSuccessfully = true;
3939
}
4040
if (dataReceivedSuccessfully) return false;

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: ftpconnect
22
description: Simple and robust dart FTP Connect Library to interact with FTP Servers.
3-
version: 2.0.8
3+
version: 2.0.9
44
#author: Salim Lachdhaf
55
homepage: https://github.com/salim-lachdhaf
66
git: https://github.com/salim-lachdhaf/dartFTP

0 commit comments

Comments
 (0)