Gomtuu fix
diff -ur '--exclude=*.dll' '--exclude=*.exe' '--exclude=build.sh' rescene/RarBlocks.cs rescene-drl/RarBlocks.cs
--- rescene/RarBlocks.cs    2010-03-29 10:48:54.000000000 -0400
+++ rescene-drl/RarBlocks.cs    2011-06-23 22:55:46.000000000 -0400
@@ -33,7 +33,7 @@
~
        protected BinaryReader reader;
        protected BinaryWriter writer;
-       protected Encoding encoding = Encoding.UTF8;
+       protected Encoding encoding = Encoding.GetEncoding(437);
~
        public ushort Crc { get; set; }
        public byte RawType { get; set; }
diff -ur '--exclude=*.dll' '--exclude=*.exe' '--exclude=build.sh' rescene/srr.cs rescene-drl/srr.cs
--- rescene/srr.cs  2010-06-09 00:14:24.000000000 -0400
+++ rescene-drl/srr.cs  2011-06-23 22:58:16.000000000 -0400
@@ -480,13 +480,14 @@
                        if (fileData.PackedSize > 0)
                        {
                            // make sure we have the correct extracted file open.  if not, attempt to locate and open it
-                           if (srcName != fileData.FileName)
+                           if (srcName != fileData.FileName.Replace('\\', Path.DirectorySeparatorChar))
                            {
                                srcName = fileData.FileName;
                                runningCrc = Crc32.StartValue;
                                if (srcfs != null)
                                    srcfs.Close();
~
+                               srcName = srcName.Replace('\\', Path.DirectorySeparatorChar);
                                FileInfo srcInfo = new FileInfo(Path.Combine(inFolder.FullName, srcName));
                                if (hints.ContainsKey(srcName.ToLower()))
                                    srcInfo = new FileInfo(Path.Combine(inFolder.FullName, hints[srcName.ToLower()]));
0000000: 5261 7221 1a07 005a 6e73 1101 0d00 0000  Rar!...Zns......
0000010: 0000 0000 36e5 74c0 8288 00c6 bbdc 02c6  ....6.t.........
0000020: bbdc 0202 d360 49d9 8c06 ab38 1430 6800  .....`I....8.0h.
0000030: 2000 0000 566f 6c2e 3031 2053 6163 7265   ...Vol.01 Sacre
0000040: 6420 6361 6e74 6174 6173 2049 2031 3520  d cantatas I 15 
0000050: 4344 735c 4344 2030 315c 3031 2042 5756  CDs\CD 01\01 BWV
0000060: 3030 3031 2d31 205f 2043 6f72 6f5f 2057  0001-1 _ Coro_ W
0000070: 6965 2053 6368 946e 206c 6575 6368 7465  ie Sch.n leuchte
0000080: 7420 6465 7220 4d6f 7267 656e 7374 6572  t der Morgenster
0000090: 6e2e 666c 6163 0001 cc40 f61d 664c 6143  n.flac...@..fLaC

Part of chat from before the fix

03:42 < gomtuu> Well, I'll have to go to bed in a few hours, but for anyone who might read this:
03:44 < gomtuu> I've since been able to get srr.exe to reconstruct my RARs, but they're damaged (most of them are missing between 1 and 5 par2 blocks)
03:45 < gomtuu> The way I got it sort-of working was be recompiling srr.cs with the SearchOption.AllDirectories flag added to the GetFiles call in the autoLocateRenamed routine, but for some reason, srr.exe complains about CRC errors while it's rebuilding, and, like I said, the RARs are damaged.
03:48 < gomtuu> (Also, that's not an ideal solution if it recursively searches the whole inputdir tree. That could be really slow.)
03:51 < gomtuu> Before I tried the SearchOption approach, I tried setting srcName = srcName.Replace('\\', Path.DirectorySeparatorChar) around line 490. That seemed to perform the correct substitution, but srr.exe still couldn't find the first file in my archive, probably because it contains an umlaut o. The error message did change from:
03:53 < gomtuu> Could not locate data file: /home/me/test/subdir/dir_in_rar\filelist.txt to /home/me/test/subdir/dir_in_rar/filelist.txt, but in my case the "filelist.txt" file has an umlaut o in it.
03:59 < gomtuu> I looked at the RAR file and the SRR file, and the umlaut o is encoded as a single byte (0x94) in both files, so I guess that's CP437. I don't know how to tell what it's encoded as in the filesystem, but my locale is set to UTF-8, so that's probably it.
03:59 < gomtuu> Also, if I use xxd (a hex viewer) to inspect srr.exe's "Could not locate data file" output, there's "EF BF BD" where the umlaut o should be. I have no idea why it would be that. If it were UTF-8, it'd be "C3 B6"…
03:59 < gomtuu> So, hopefully that helps.
04:02 < gomtuu> I'll stay in the channel this time in case someone wants to reply.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License