[Mono-bugs] [Bug 72739][Nor] Changed - XmlSerializer will serialize invalid XML characters but complain at deserialization.
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Tue, 1 Mar 2005 15:09:44 -0500 (EST)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by lluis@ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=72739
--- shadow/72739 2005-02-25 14:37:54.000000000 -0500
+++ shadow/72739.tmp.17274 2005-03-01 15:09:44.000000000 -0500
@@ -41,6 +41,17 @@
I have no problem with it not deserializing and loading invalid XML
off the wire, that's fine. But (without having checked whether MS
.NET does this) it does seem like a bug that it will serialize and put
invalid XML on the wire. XmlSerializer will create an invalid
document if its input has an invalid character, rather than either
removing it or throwing an exception.
+
+------- Additional Comments From lluis@ximian.com 2005-03-01 15:09 -------
+I don't think that allowing the serialization of invalid chars is a
+bug. In .NET 2.0 there is a new flag to enable/disable character
+checking, so I guess that there are some scenarios in which
+serialization of non-standard chars is needed. Notice that this is not
+a serialization issue, but a general xml reading/writing issues.
+
+In any case, .NET 1.1 does not check for invalid chars when writing,
+and we need to keep compatible even if we don't like this behavior,
+since existing applications may rely on it.