[Mono-list] Problem parsing a file with non-UTF8 characters

Jaime Anguiano Olarra jaime@gnome.org
Fri, 26 Sep 2003 03:15:16 +0200


Hi all,

I am writing a set of tools in order to reopen the Mono Weekly News (as
doing them by hand took too much time), you can see the actual status of
them here: http://monoevo.sf.net/mwn/tools/ 

My big problem now is with monocvsspy.cs. It has been working well with
the files I have passed it during the tests, but today I tried the
actual 2003-September.txt mono-patches file. The result is here:

jaime@light:~/src/mwnripper$ ./monocvsspy.exe cvslog-prev
Enter file to parse: (default 'cvslog-prev')
This is the time now: Friday, 26 September 2003 01:12:09
Enter starting day (permited values [1-31]): 22
Enter ending day (permited values [1-31]): 25
Enter starting month (f.ex: 'Apr'): Sep
Searching from 22 to 25, Sep
 
Unhandled Exception: System.ArgumentException: Arg_InvalidUTF8
Parameter name: bytes
in <0x005e1> 00 System.Text.UTF8Encoding:InternalGetChars
(byte[],int,int,char[],int,uint&,uint&,bool,bool)
in <0x00038> 00 .UTF8Decoder:GetChars (byte[],int,int,char[],int)
in <0x00140> 00 System.IO.StreamReader:ReadBuffer ()
in <0x00051> 08 System.IO.StreamReader:ReadBuffer ()
in <0x00026> 00 System.IO.StreamReader:Read ()
in <0x00060> 00 System.IO.StreamReader:ReadLine ()
in <0x0070d> 00 MonoWeeklyNews.MonoCvsSpy:ParsePatches (string)
in <0x00093> 00 MonoWeeklyNews.MonoCvsSpy:Main (string[])
 
I really don't know how to solve it. It seems to say: "you are trying 
to read characters out of UTF8". Is it because my ~3 weeks old cvs setup
is too old or is it something more sophisticated. I am upgrading 
right now but I don't think the problem will be there.

Cheers,

Jaime.
-- 
// http://www.go-mono.org -- The Mono Project. .NET + freedom.