<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Whaly&#039;s World &#187; encoding</title>
	<atom:link href="http://baleinoid.com/whaly/tag/encoding/feed/" rel="self" type="application/rss+xml" />
	<link>http://baleinoid.com/whaly</link>
	<description>tail -f /var/log/whaly</description>
	<lastBuildDate>Wed, 10 Mar 2010 20:19:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>XmlWriter and UTF-8 encoding without signature</title>
		<link>http://baleinoid.com/whaly/2009/07/xmlwriter-and-utf-8-encoding-without-signature/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=xmlwriter-and-utf-8-encoding-without-signature</link>
		<comments>http://baleinoid.com/whaly/2009/07/xmlwriter-and-utf-8-encoding-without-signature/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 19:41:13 +0000</pubDate>
		<dc:creator>whaly</dc:creator>
				<category><![CDATA[Microsoft .NET]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[utf8]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://baleinoid.com/whaly/?p=3</guid>
		<description><![CDATA[I used this code to serialize some objects in Xml : XmlWriter writer = new XmlTextWriter(stream, Encoding.UTF8); But the output contains an UTF header, the Byte Order Mark (BOM). The use of the header/signature is usually for xml file, if you want to use the ouput in an HttpResponse, you don't need the signature. (some [...]]]></description>
			<content:encoded><![CDATA[<p>I used this code to serialize some objects in Xml :</p>
<pre class="brush: csharp; light: true;">XmlWriter writer = new XmlTextWriter(stream, Encoding.UTF8);</pre>
<p>But the output contains an UTF header, the Byte Order Mark (BOM). The use of the header/signature is usually for xml file, if you want to use the ouput in an HttpResponse, you don't need the signature. (some parser can cause a parsing error in java, like org.xml.sax.SAXException).</p>
<p>Here is the change to remove the BOM :</p>
<pre class="brush: csharp; light: true;">XmlWriter writer = new XmlTextWriter(stream, new UTF8Encoding(false));</pre>
]]></content:encoded>
			<wfw:commentRss>http://baleinoid.com/whaly/2009/07/xmlwriter-and-utf-8-encoding-without-signature/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
