mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[Symbian Installation File] Add support for Unicode.
This commit is contained in:
@@ -72,7 +72,7 @@ public partial class Symbian
|
|||||||
|
|
||||||
public void GetInformation(IFilter filter, Encoding encoding, out string information)
|
public void GetInformation(IFilter filter, Encoding encoding, out string information)
|
||||||
{
|
{
|
||||||
encoding ??= Encoding.GetEncoding("windows-1252");
|
_encoding= encoding ?? Encoding.GetEncoding("windows-1252");
|
||||||
information = "";
|
information = "";
|
||||||
var description = new StringBuilder();
|
var description = new StringBuilder();
|
||||||
var languages = new List<string>();
|
var languages = new List<string>();
|
||||||
@@ -120,6 +120,9 @@ public partial class Symbian
|
|||||||
AaruConsole.DebugWriteLine(MODULE_NAME, "sh.reserved1 = {0}", sh.reserved1);
|
AaruConsole.DebugWriteLine(MODULE_NAME, "sh.reserved1 = {0}", sh.reserved1);
|
||||||
AaruConsole.DebugWriteLine(MODULE_NAME, "sh.reserved2 = {0}", sh.reserved2);
|
AaruConsole.DebugWriteLine(MODULE_NAME, "sh.reserved2 = {0}", sh.reserved2);
|
||||||
|
|
||||||
|
if(sh.options.HasFlag(SymbianOptions.IsUnicode))
|
||||||
|
_encoding = Encoding.Unicode;
|
||||||
|
|
||||||
var br = new BinaryReader(stream);
|
var br = new BinaryReader(stream);
|
||||||
|
|
||||||
// Go to enumerate languages
|
// Go to enumerate languages
|
||||||
@@ -153,7 +156,7 @@ public partial class Symbian
|
|||||||
|
|
||||||
br.BaseStream.Seek(componentRecord.namesPointers[i], SeekOrigin.Begin);
|
br.BaseStream.Seek(componentRecord.namesPointers[i], SeekOrigin.Begin);
|
||||||
buffer = br.ReadBytes((int)componentRecord.namesLengths[i]);
|
buffer = br.ReadBytes((int)componentRecord.namesLengths[i]);
|
||||||
componentRecord.names[i] = encoding.GetString(buffer);
|
componentRecord.names[i] = _encoding.GetString(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Go to capabilities (???)
|
// Go to capabilities (???)
|
||||||
@@ -239,7 +242,6 @@ public partial class Symbian
|
|||||||
// description.AppendFormat("{0} = {1}", kvp.Key, kvp.Value).AppendLine();
|
// description.AppendFormat("{0} = {1}", kvp.Key, kvp.Value).AppendLine();
|
||||||
|
|
||||||
// Set instance values
|
// Set instance values
|
||||||
_encoding = encoding;
|
|
||||||
_files = new List<DecodedFileRecord>();
|
_files = new List<DecodedFileRecord>();
|
||||||
|
|
||||||
uint currentFile = 0;
|
uint currentFile = 0;
|
||||||
@@ -250,6 +252,8 @@ public partial class Symbian
|
|||||||
Parse(br, ref offset, ref currentFile, sh.files, languages);
|
Parse(br, ref offset, ref currentFile, sh.files, languages);
|
||||||
} while(currentFile < sh.files);
|
} while(currentFile < sh.files);
|
||||||
|
|
||||||
|
description.AppendLine();
|
||||||
|
|
||||||
// Files appear on .sis in the reverse order they should be processed
|
// Files appear on .sis in the reverse order they should be processed
|
||||||
_files.Reverse();
|
_files.Reverse();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user