🐛Corrected miscalling current encoding when identifying filesystems.

This commit is contained in:
2017-12-26 06:36:15 +00:00
parent f66a0bdd42
commit 2eca6ec8be
3 changed files with 8 additions and 8 deletions

View File

@@ -66,7 +66,6 @@ namespace DiscImageChef.Filesystems
public virtual bool Identify(IMediaImage imagePlugin, Partition partition) public virtual bool Identify(IMediaImage imagePlugin, Partition partition)
{ {
currentEncoding = Encoding.BigEndianUnicode;
if(2 + partition.Start >= partition.End) return false; if(2 + partition.Start >= partition.End) return false;
ushort drSigWord; ushort drSigWord;
@@ -107,6 +106,7 @@ namespace DiscImageChef.Filesystems
public virtual void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, public virtual void GetInformation(IMediaImage imagePlugin, Partition partition, out string information,
Encoding encoding) Encoding encoding)
{ {
currentEncoding = Encoding.BigEndianUnicode;
information = ""; information = "";
ushort drSigWord; ushort drSigWord;

View File

@@ -69,12 +69,12 @@ namespace DiscImageChef.Filesystems.ISO9660
Array.Copy(vdSector, 0x001 + xaOff, vdMagic, 0, 5); Array.Copy(vdSector, 0x001 + xaOff, vdMagic, 0, 5);
Array.Copy(vdSector, 0x009 + xaOff, hsMagic, 0, 5); Array.Copy(vdSector, 0x009 + xaOff, hsMagic, 0, 5);
DicConsole.DebugWriteLine("ISO9660 plugin", "VDMagic = {0}", currentEncoding.GetString(vdMagic)); DicConsole.DebugWriteLine("ISO9660 plugin", "VDMagic = {0}", Encoding.ASCII.GetString(vdMagic));
DicConsole.DebugWriteLine("ISO9660 plugin", "HSMagic = {0}", currentEncoding.GetString(hsMagic)); DicConsole.DebugWriteLine("ISO9660 plugin", "HSMagic = {0}", Encoding.ASCII.GetString(hsMagic));
return currentEncoding.GetString(vdMagic) == ISO_MAGIC || return Encoding.ASCII.GetString(vdMagic) == ISO_MAGIC ||
currentEncoding.GetString(hsMagic) == HIGH_SIERRA_MAGIC || Encoding.ASCII.GetString(hsMagic) == HIGH_SIERRA_MAGIC ||
currentEncoding.GetString(vdMagic) == CDI_MAGIC; Encoding.ASCII.GetString(vdMagic) == CDI_MAGIC;
} }
public virtual void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) public virtual void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)

View File

@@ -116,9 +116,9 @@ namespace DiscImageChef.Filesystems
byte[] coherent_string = new byte[6]; byte[] coherent_string = new byte[6];
Array.Copy(sb_sector, 0x1E4, coherent_string, 0, 6); // Coherent UNIX s_fname location Array.Copy(sb_sector, 0x1E4, coherent_string, 0, 6); // Coherent UNIX s_fname location
string s_fname = StringHandlers.CToString(coherent_string, currentEncoding); string s_fname = StringHandlers.CToString(coherent_string);
Array.Copy(sb_sector, 0x1EA, coherent_string, 0, 6); // Coherent UNIX s_fpack location Array.Copy(sb_sector, 0x1EA, coherent_string, 0, 6); // Coherent UNIX s_fpack location
string s_fpack = StringHandlers.CToString(coherent_string, currentEncoding); string s_fpack = StringHandlers.CToString(coherent_string);
if(s_fname == COH_FNAME && s_fpack == COH_FPACK || s_fname == COH_XXXXX && s_fpack == COH_XXXXX || if(s_fname == COH_FNAME && s_fpack == COH_FPACK || s_fname == COH_XXXXX && s_fpack == COH_XXXXX ||
s_fname == COH_XXXXS && s_fpack == COH_XXXXN) return true; s_fname == COH_XXXXS && s_fpack == COH_XXXXN) return true;