mirror of
https://github.com/robmcmullen/atrcopy.git
synced 2025-01-16 02:32:52 +00:00
Fixed #12: changed utf-8 encoding to latin1
This commit is contained in:
parent
7e3159b175
commit
223f8fc1ff
@ -97,8 +97,7 @@ class AtariDosDirent(Dirent):
|
||||
self.parse_raw_dirent(image, bytes)
|
||||
|
||||
def __str__(self):
|
||||
# return (b'File #%-2d (%s) %03d %-8s%-3s %03d' % (self.file_num, self.summary.encode("utf-8"), self.starting_sector, self.basename, self.ext, self.num_sectors)).decode("utf-8")
|
||||
return "File #%-2d (%s) %03d %-8s%-3s %03d" % (self.file_num, self.summary, self.starting_sector, self.basename.decode("utf-8"), self.ext.decode("utf-8"), self.num_sectors)
|
||||
return "File #%-2d (%s) %03d %-8s%-3s %03d" % (self.file_num, self.summary, self.starting_sector, self.basename.decode("latin1"), self.ext.decode("latin1"), self.num_sectors)
|
||||
|
||||
def __eq__(self, other):
|
||||
return self.__class__ == other.__class__ and self.filename == other.filename and self.starting_sector == other.starting_sector and self.num_sectors == other.num_sectors
|
||||
@ -106,7 +105,7 @@ class AtariDosDirent(Dirent):
|
||||
@property
|
||||
def filename(self):
|
||||
ext = (b'.' + self.ext) if self.ext else b''
|
||||
return (self.basename + ext).decode('utf-8')
|
||||
return (self.basename + ext).decode('latin1')
|
||||
|
||||
@property
|
||||
def summary(self):
|
||||
@ -222,7 +221,7 @@ class AtariDosDirent(Dirent):
|
||||
|
||||
def set_values(self, filename, filetype, index):
|
||||
if type(filename) is not bytes:
|
||||
filename = filename.encode("utf-8")
|
||||
filename = filename.encode("latin1")
|
||||
if b'.' in filename:
|
||||
filename, ext = filename.split(b'.', 1)
|
||||
else:
|
||||
|
@ -38,7 +38,7 @@ class SpartaDosDirent(AtariDosDirent):
|
||||
deleted = "d" if self.deleted else "."
|
||||
locked = "*" if self.locked else " "
|
||||
flags = "%s%s%s%s%s %03d" % (output, subdir, in_use, deleted, locked, self.starting_sector)
|
||||
return "File #%-2d (%s) %-8s%-3s %8d %s" % (self.file_num, flags, self.basename.decode('utf-8'), self.ext.decode('utf-8'), self.length, self.str_timestamp)
|
||||
return "File #%-2d (%s) %-8s%-3s %8d %s" % (self.file_num, flags, self.basename.decode('latin1'), self.ext.decode('latin1'), self.length, self.str_timestamp)
|
||||
|
||||
@property
|
||||
def verbose_info(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user