Author: atsushi
Date: 2008-02-08 09:07:36 -0500 (Fri, 08 Feb 2008)
New Revision: 95248
Modified:
trunk/olive/class/System.Runtime.Serialization/System.Xml/ChangeLog
trunk/olive/class/System.Runtime.Serialization/System.Xml/XmlDictionaryWriter.cs
Log:
2008-02-08 Atsushi Enomoto <[EMAIL PROTECTED]>
* XmlDictionaryWriter.cs : Even with UTF8 (marked) .net does not
output BOMs, so use always unmarked utf8 for any UTF8 encodings.
Modified: trunk/olive/class/System.Runtime.Serialization/System.Xml/ChangeLog
===================================================================
--- trunk/olive/class/System.Runtime.Serialization/System.Xml/ChangeLog
2008-02-08 14:06:21 UTC (rev 95247)
+++ trunk/olive/class/System.Runtime.Serialization/System.Xml/ChangeLog
2008-02-08 14:07:36 UTC (rev 95248)
@@ -1,5 +1,10 @@
2008-02-08 Atsushi Enomoto <[EMAIL PROTECTED]>
+ * XmlDictionaryWriter.cs : Even with UTF8 (marked) .net does not
+ output BOMs, so use always unmarked utf8 for any UTF8 encodings.
+
+2008-02-08 Atsushi Enomoto <[EMAIL PROTECTED]>
+
* XmlDictionaryWriter.cs : Since it does not support XML declaration
its encoding is limited to utf16 and utf8. Null argument check.
Modified:
trunk/olive/class/System.Runtime.Serialization/System.Xml/XmlDictionaryWriter.cs
===================================================================
---
trunk/olive/class/System.Runtime.Serialization/System.Xml/XmlDictionaryWriter.cs
2008-02-08 14:06:21 UTC (rev 95247)
+++
trunk/olive/class/System.Runtime.Serialization/System.Xml/XmlDictionaryWriter.cs
2008-02-08 14:07:36 UTC (rev 95248)
@@ -34,6 +34,8 @@
{
public abstract partial class XmlDictionaryWriter : XmlWriter
{
+ static readonly Encoding utf8_unmarked = new UTF8Encoding
(false);
+
int depth;
protected XmlDictionaryWriter ()
@@ -111,6 +113,8 @@
return CreateTextWriter (stream, encoding, false);
}
+ // BTW looks like it creates an instance of different
+ // implementation than those from XmlWriter.Create().
public static XmlDictionaryWriter CreateTextWriter (
Stream stream, Encoding encoding, bool ownsStream)
{
@@ -123,6 +127,7 @@
case 1200:
case 1201: // utf-16
case 65001: // utf-8
+ encoding = utf8_unmarked;
break;
default:
throw new XmlException (String.Format ("XML
declaration is required for encoding code page {0} but this XmlWriter does not
support XML declaration.", encoding.CodePage));
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches