First of all:

I get error when try to compile mcs tree:
System.Xml.Schema\XmlSchemaSimpleTypeRestriction.cs(634) error CS0019:
Operator
`<' cannot be applied to operands of type `bool' and `int'

This seems to be false alarm. Do you get it as well?

Back to the original problem:

You are right, UTF8Encoding works as expected.

The the problem may be in SeekableStreamReader.

The following code skipped "é" and "á" as expected so mcs should compile the
code without problems as it does not get them from UTF8Encoding:

using System;
using System.IO;
using System.Text;

public class Test
{
public static void Main ()
{
 StreamReader reader = new StreamReader("ComIStreamMarshaler.cs", new
UTF8Encoding(false, false), false);
 StreamWriter writer = new StreamWriter("ComIStreamMarshaler1.cs", false,
new UTF8Encoding(false, false));
 writer.Write(reader.ReadToEnd());
 reader.Close();
 writer.Close();
}
}

Kornél

----- Original Message -----
From: "Atsushi Eno" <[EMAIL PROTECTED]>
To: "Kornél Pál" <[EMAIL PROTECTED]>
Cc: "Jonathan S. Chambers" <[EMAIL PROTECTED]>;
<mono-devel-list@lists.ximian.com>
Sent: Thursday, August 25, 2005 6:18 PM
Subject: Re: [Mono-dev] Build error in svn


As a quick workaround I added /codepage:28591 for all problematic
assemblies. After that I feel reluctant to fix those bugs :-/

Kornél Pál wrote:
UTF8Encoding should ignore them anyway when throwOnInvalidBytes = false
(default) so i think UTF8Encoding is bugous as well.

However the example code below did not show different results
between MS.NET and Mono.

using System;
using System.Text;

public class Test
{
        public static void Main ()
        {
                string s = Encoding.UTF8.GetString (new byte [] {0xE9});
                foreach (char c in s)
                        Console.WriteLine ("{0:x02} ", (int) c);
        }
}

Atsushi Eno


_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to