dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] ResourceReader and resgen choke on valid .resources fi


From: Bruno Haible
Subject: [Pnet-developers] ResourceReader and resgen choke on valid .resources files
Date: Mon, 29 Dec 2003 12:42:31 +0100
User-agent: KMail/1.5

Using pnet-0.6.0.

The ResourceReader and resgen utility choke on .resources files that
have been generated through monoresgen (or, equivalently, through
mono's ResourceWriter class).

To reproduce:

========================== hello.cs ======================
using System;
using System.Resources;
using System.Collections;
class Hello {
  static void Main () {
    ResourceReader rr = new ResourceReader("foo.mono.resources");
    foreach (DictionaryEntry entry in rr);
  }
}
=========================== foo.po =======================
msgid "Simple"
msgstr "Einfach"
==========================================================

$ cscc hello.cs -o hello.exe
$ monoresgen foo.po foo.mono.resources
Read in 1 resources from 'foo.po'
Writing resource file...  Done.
$ ls -l foo.mono.resources
-rw-r--r--    1 bruno    user          174 2003-12-28 17:56 foo.mono.resources
$ ilrun hello.exe
Uncaught exception: System.IO.EndOfStreamException: Attempt to seek beyond the 
end of the stream
        at System.IO.FileStream.Seek(Int64, SeekOrigin) in 
./System/IO/FileStream.cs
        at System.Resources.ResourceEnumerator.MoveNext() in 
./System/Resources/ResourceReader.cs
        at Hello.Main()

$ resgen foo.mono.resources foo2.po
foo.mono.resources: invalid offset to resource value

======================== hex dump of foo.mono.resources ==================
000000  CE CA EF BE 01 00 00 00 51 00 00 00 29 53 79 73  ........Q...)Sys
000010  74 65 6D 2E 52 65 73 6F 75 72 63 65 73 2E 52 65  tem.Resources.Re
000020  73 6F 75 72 63 65 52 65 61 64 65 72 2C 20 6D 73  sourceReader, ms
000030  63 6F 72 6C 69 62 26 53 79 73 74 65 6D 2E 52 65  corlib&System.Re
000040  73 6F 75 72 63 65 73 2E 52 65 73 6F 75 72 63 65  sources.Resource
000050  53 65 74 2C 20 6D 73 63 6F 72 6C 69 62 01 00 00  Set, mscorlib...
000060  00 01 00 00 00 01 00 00 00 17 53 79 73 74 65 6D  ..........System
000070  2E 53 74 72 69 6E 67 2C 20 6D 73 63 6F 72 6C 69  .String, mscorli
000080  62 50 41 44 50 41 44 50 EB 91 C2 C7 00 00 00 00  bPADPADP........
000090  A5 00 00 00 0C 53 00 69 00 6D 00 70 00 6C 00 65  .....S.i.m.p.l.e
0000a0  00 00 00 00 00 00 07 45 69 6E 66 61 63 68        .......Einfach
==========================================================================

======================= foo.mono.resources uuencoded =====================
$ uudecode <<\EOF
begin 644 foo.mono.resources
address@hidden<W1E;2Y297-O=7)C97,N4F5S;W5R8V5296%D97(L
M(&US8V]R;&EB)E-Y<W1E;2Y297-O=7)C97,N4F5S;W5R8V53970L(&US8V]R
M;&EB`0````$````!````%U-Y<W1E;2Y3=')I;F<L(&US8V]R;&EB4$%$4$%$
G4.N1PL<`````I0````Q3`&D`;0!P`&P`90````````=%:6YF86-H
`
end
EOF
==========================================================================



reply via email to

[Prev in Thread] Current Thread [Next in Thread]