Author: atsushi
Date: 2005-11-28 05:34:41 -0500 (Mon, 28 Nov 2005)
New Revision: 53544
Modified:
trunk/mcs/class/corlib/System.Text/ChangeLog
trunk/mcs/class/corlib/System.Text/NormalizationForm.cs
trunk/mcs/class/corlib/System.Text/UTF32Encoding.cs
Log:
2005-11-28 Atsushi Enomoto <[EMAIL PROTECTED]>
* UTF32Encoding.cs : Sealed. Added the overload which has
throwOnInvalid parameter.
* NormalizationForm.cs : removed [Serializable].
Modified: trunk/mcs/class/corlib/System.Text/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.Text/ChangeLog 2005-11-28 10:04:12 UTC
(rev 53543)
+++ trunk/mcs/class/corlib/System.Text/ChangeLog 2005-11-28 10:34:41 UTC
(rev 53544)
@@ -1,5 +1,11 @@
2005-11-28 Atsushi Enomoto <[EMAIL PROTECTED]>
+ * UTF32Encoding.cs : Sealed. Added the overload which has
+ throwOnInvalid parameter.
+ * NormalizationForm.cs : removed [Serializable].
+
+2005-11-28 Atsushi Enomoto <[EMAIL PROTECTED]>
+
* Encoding.cs : added UTF32.
2005-11-28 Atsushi Enomoto <[EMAIL PROTECTED]>
Modified: trunk/mcs/class/corlib/System.Text/NormalizationForm.cs
===================================================================
--- trunk/mcs/class/corlib/System.Text/NormalizationForm.cs 2005-11-28
10:04:12 UTC (rev 53543)
+++ trunk/mcs/class/corlib/System.Text/NormalizationForm.cs 2005-11-28
10:34:41 UTC (rev 53544)
@@ -30,7 +30,6 @@
#if NET_2_0
namespace System.Text
{
- [Serializable]
public enum NormalizationForm {
FormC = 1,
FormD = 2,
Modified: trunk/mcs/class/corlib/System.Text/UTF32Encoding.cs
===================================================================
--- trunk/mcs/class/corlib/System.Text/UTF32Encoding.cs 2005-11-28 10:04:12 UTC
(rev 53543)
+++ trunk/mcs/class/corlib/System.Text/UTF32Encoding.cs 2005-11-28 10:34:41 UTC
(rev 53544)
@@ -6,7 +6,7 @@
*
* Copyright (C) 2005 Novell, Inc. http://www.novell.com
*
- * It is almost copied from UnicodeEncoding.cs.
+ * The basic part (now almost nothing) is copied from UnicodeEncoding.cs.
* Original copyrights goes here:
*
* Copyright (c) 2001, 2002 Southern Storm Software, Pty Ltd
@@ -39,7 +39,7 @@
using System;
[Serializable]
-public class UTF32Encoding : Encoding
+public sealed class UTF32Encoding : Encoding
{
// Magic numbers used by Windows for UTF32.
internal const int UTF32_CODE_PAGE = 12000;
@@ -50,16 +50,28 @@
private bool byteOrderMark;
// Constructors.
- public UTF32Encoding () : this (false, true)
+ public UTF32Encoding () : this (false, true, false)
{
}
public UTF32Encoding (bool bigEndian, bool byteOrderMark)
+ : this (bigEndian, byteOrderMark, false)
+ {
+ }
+
+ public UTF32Encoding (bool bigEndian, bool byteOrderMark, bool
throwOnInvalid)
: base ((bigEndian ? BIG_UTF32_CODE_PAGE : UTF32_CODE_PAGE))
{
this.bigEndian = bigEndian;
this.byteOrderMark = byteOrderMark;
+ if (throwOnInvalid)
+ SetFallbackInternal (EncoderFallback.ExceptionFallback,
+ DecoderFallback.ExceptionFallback);
+ else
+ SetFallbackInternal
(EncoderFallback.ReplacementFallback,
+ DecoderFallback.ReplacementFallback);
+
if (bigEndian){
body_name = "utf-32BE";
encoding_name = "UTF-32 (Big-Endian)";
@@ -318,7 +330,8 @@
if (enc != null) {
return (codePage == enc.codePage &&
bigEndian == enc.bigEndian &&
- byteOrderMark == enc.byteOrderMark);
+ byteOrderMark == enc.byteOrderMark &&
+ base.Equals (value));
} else {
return false;
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches