Added support for different character encodings.

This commit is contained in:
2017-06-06 21:23:20 +01:00
parent d6c37bc47b
commit 76e16db616
75 changed files with 463 additions and 445 deletions

View File

@@ -48,7 +48,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
contents = new List<string>();
foreach(PascalFileEntry ent in fileEntries)
contents.Add(StringHandlers.PascalToString(ent.filename));
contents.Add(StringHandlers.PascalToString(ent.filename, CurrentEncoding));
if(debug)
{

View File

@@ -185,7 +185,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
foreach(PascalFileEntry ent in fileEntries)
{
if(string.Compare(path, StringHandlers.PascalToString(ent.filename), StringComparison.InvariantCultureIgnoreCase) == 0)
if(string.Compare(path, StringHandlers.PascalToString(ent.filename, CurrentEncoding), StringComparison.InvariantCultureIgnoreCase) == 0)
{
entry = ent;
return Errno.NoError;

View File

@@ -139,7 +139,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
return;
sbInformation.AppendFormat("Volume record spans from block {0} to block {1}", volEntry.firstBlock, volEntry.lastBlock).AppendLine();
sbInformation.AppendFormat("Volume name: {0}", StringHandlers.PascalToString(volEntry.volumeName)).AppendLine();
sbInformation.AppendFormat("Volume name: {0}", StringHandlers.PascalToString(volEntry.volumeName, CurrentEncoding)).AppendLine();
sbInformation.AppendFormat("Volume has {0} blocks", volEntry.blocks).AppendLine();
sbInformation.AppendFormat("Volume has {0} files", volEntry.files).AppendLine();
sbInformation.AppendFormat("Volume last booted at {0}", DateHandlers.UCSDPascalToDateTime(volEntry.lastBoot)).AppendLine();
@@ -153,7 +153,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
xmlFSType.Files = volEntry.files;
xmlFSType.FilesSpecified = true;
xmlFSType.Type = "UCSD Pascal";
xmlFSType.VolumeName = StringHandlers.PascalToString(volEntry.volumeName);
xmlFSType.VolumeName = StringHandlers.PascalToString(volEntry.volumeName, CurrentEncoding);
return;
}

View File

@@ -102,7 +102,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
xmlFSType.Files = mountedVolEntry.files;
xmlFSType.FilesSpecified = true;
xmlFSType.Type = "UCSD Pascal";
xmlFSType.VolumeName = StringHandlers.PascalToString(mountedVolEntry.volumeName);
xmlFSType.VolumeName = StringHandlers.PascalToString(mountedVolEntry.volumeName, CurrentEncoding);
mounted = true;

View File

@@ -32,6 +32,7 @@
using System;
using System.Collections.Generic;
using System.Text;
using DiscImageChef.ImagePlugins;
namespace DiscImageChef.Filesystems.UCSDPascal
@@ -52,13 +53,16 @@ namespace DiscImageChef.Filesystems.UCSDPascal
{
Name = "U.C.S.D. Pascal filesystem";
PluginUUID = new Guid("B0AC2CB5-72AA-473A-9200-270B5A2C2D53");
CurrentEncoding = new Claunia.Encoding.LisaRoman();
}
public PascalPlugin(ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
public PascalPlugin(ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, Encoding encoding)
{
device = imagePlugin;
Name = "U.C.S.D. Pascal filesystem";
PluginUUID = new Guid("B0AC2CB5-72AA-473A-9200-270B5A2C2D53");
if(encoding == null) // TODO: Until Apple ][ encoding is implemented
CurrentEncoding = new Claunia.Encoding.LisaRoman();
}
public override Errno ListXAttr(string path, ref List<string> xattrs)