🐛Add support for Radix-50 character encoding, fixes #103

This commit is contained in:
2017-12-27 21:57:07 +00:00
parent 41180352de
commit 0d034ce4d0
6 changed files with 17 additions and 13 deletions

View File

@@ -600,6 +600,7 @@
<e p="ext2FS.cs" t="Include" />
<e p="extFS.cs" t="Include" />
<e p="obj" t="ExcludeRecursive" />
<e p="packages.config" t="Include" />
</e>
<e p="DiscImageChef.Filters" t="IncludeRecursive">
<e p="AppleDouble.cs" t="Include" />

View File

@@ -31,8 +31,8 @@
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="Claunia.Encoding, Version=1.0.6569.33160, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\Claunia.Encoding.1.3.0\lib\portable40-net40+sl5+win8+wp8\Claunia.Encoding.dll</HintPath>
<Reference Include="Claunia.Encoding, Version=1.4.6570.38892, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\Claunia.Encoding.1.4.0\lib\portable40-net40+sl5+win8+wp8\Claunia.Encoding.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Xml" />
@@ -215,6 +215,9 @@
</EmbeddedResource>
<EmbeddedResource Include="CPM\cpmdefs.xml" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ProjectExtensions>
<MonoDevelop>
<Properties>

View File

@@ -33,9 +33,11 @@
using System;
using System.Runtime.InteropServices;
using System.Text;
using Claunia.Encoding;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using Schemas;
using Encoding = System.Text.Encoding;
namespace DiscImageChef.Filesystems
{
@@ -66,7 +68,7 @@ namespace DiscImageChef.Filesystems
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information,
Encoding encoding)
{
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-1");
Encoding = new Radix50();
information = "";
StringBuilder sb = new StringBuilder();
@@ -90,15 +92,13 @@ namespace DiscImageChef.Filesystems
ushort check = 0;
for(int i = 0; i < 512; i += 2) check += BitConverter.ToUInt16(hbSector, i);
sb.AppendFormat("Volume format is {0}", StringHandlers.SpacePaddedToString(homeblock.format, Encoding))
.AppendLine();
sb.AppendFormat("Volume format is {0}",
StringHandlers.SpacePaddedToString(homeblock.format, Encoding.ASCII)).AppendLine();
sb.AppendFormat("{0} sectors per cluster ({1} bytes)", homeblock.cluster, homeblock.cluster * 512)
.AppendLine();
sb.AppendFormat("First directory segment starts at block {0}", homeblock.rootBlock).AppendLine();
sb.AppendFormat("Volume owner is \"{0}\"",
StringHandlers.SpacePaddedToString(homeblock.ownername, Encoding)).AppendLine();
sb.AppendFormat("Volume label: \"{0}\"", StringHandlers.SpacePaddedToString(homeblock.volname, Encoding))
.AppendLine();
sb.AppendFormat("Volume owner is \"{0}\"", Encoding.GetString(homeblock.ownername).TrimEnd()).AppendLine();
sb.AppendFormat("Volume label: \"{0}\"", Encoding.GetString(homeblock.volname).TrimEnd()).AppendLine();
sb.AppendFormat("Checksum: 0x{0:X4} (calculated 0x{1:X4})", homeblock.checksum, check).AppendLine();
byte[] bootBlock = imagePlugin.ReadSector(0);

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Claunia.Encoding" version="1.3.0" targetFramework="net40" />
<package id="Claunia.Encoding" version="1.4.0" targetFramework="net40" />
</packages>

View File

@@ -34,8 +34,8 @@
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="Claunia.Encoding, Version=1.0.6569.33160, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\Claunia.Encoding.1.3.0\lib\portable40-net40+sl5+win8+wp8\Claunia.Encoding.dll</HintPath>
<Reference Include="Claunia.Encoding, Version=1.4.6570.38892, Culture=neutral, PublicKeyToken=null">
<HintPath>..\packages\Claunia.Encoding.1.4.0\lib\portable40-net40+sl5+win8+wp8\Claunia.Encoding.dll</HintPath>
</Reference>
<Reference Include="SharpCompress, Version=0.19.2.0, Culture=neutral, PublicKeyToken=afb0a02973931d96">
<HintPath>..\packages\SharpCompress.0.19.2\lib\net35\SharpCompress.dll</HintPath>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Claunia.Encoding" version="1.3.0" targetFramework="net40" />
<package id="Claunia.Encoding" version="1.4.0" targetFramework="net40" />
<package id="CommandLineParser" version="2.1.1-beta" targetFramework="net40" />
<package id="SharpCompress" version="0.19.2" targetFramework="net40" />
</packages>