* UTF8Encoding.cs: Use Equals to compare the objects as the
fallback objects do not overload operator ==. The comparison
was previously failing.
svn path=/trunk/mcs/; revision=138786
+2009-07-28 Miguel de Icaza <miguel@novell.com>
+
+ * UTF8Encoding.cs: Use Equals to compare the objects as the
+ fallback objects do not overload operator ==. The comparison
+ was previously failing.
+
2009-07-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
* StringBuilder.cs: don't throw on null values in ctor(string, int).
2009-07-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
* StringBuilder.cs: don't throw on null values in ctor(string, int).
if (enc != null) {
#if NET_2_0
return (codePage == enc.codePage &&
if (enc != null) {
#if NET_2_0
return (codePage == enc.codePage &&
- emitIdentifier == enc.emitIdentifier &&
- DecoderFallback == enc.DecoderFallback &&
- EncoderFallback == enc.EncoderFallback);
+ emitIdentifier == enc.emitIdentifier &&
+ DecoderFallback.Equals (enc.DecoderFallback) &&
+ EncoderFallback.Equals (enc.EncoderFallback));
#else
return (codePage == enc.codePage &&
emitIdentifier == enc.emitIdentifier &&
#else
return (codePage == enc.codePage &&
emitIdentifier == enc.emitIdentifier &&
Assert.IsTrue (utf8.IsMailNewsSave);
}
Assert.IsTrue (utf8.IsMailNewsSave);
}
+ [Test]
+ public void TestCompat ()
+ {
+ Assert.IsTrue (new UTF8Encoding ().Equals (new UTF8Encoding ()));
+ }
+
[Test]
public void TestEncodingGetBytes1()
{
[Test]
public void TestEncodingGetBytes1()
{