<?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>Fri, 06 Apr 2012 21:28:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</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&#038;utm_medium=rss&#038;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 : 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 [...]]]></description>
			<content:encoded><![CDATA[<p>I used this code to serialize some objects in Xml :</p>
<pre class="brush: csharp; light: true; title: ; notranslate">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; title: ; notranslate">XmlWriter writer = new XmlTextWriter(stream, new UTF8Encoding(false));</pre>
 <p><a href="http://baleinoid.com/whaly/wordpress/?flattrss_redirect&amp;id=3&amp;md5=ef99945c85c9b851c21f2490f8525ae3" title="Flattr" target="_blank"><img src="http://baleinoid.com/whaly/wordpress/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://baleinoid.com/whaly/2009/07/xmlwriter-and-utf-8-encoding-without-signature/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<atom:link rel="payment" href="https://flattr.com/submit/auto?user_id=whaly&amp;popout=1&amp;url=http%3A%2F%2Fbaleinoid.com%2Fwhaly%2F2009%2F07%2Fxmlwriter-and-utf-8-encoding-without-signature%2F&amp;language=en_GB&amp;category=text&amp;title=XmlWriter+and+UTF-8+encoding+without+signature&amp;description=I+used+this+code+to+serialize+some+objects+in+Xml+%3A+But+the+output+contains+an+UTF+header%2C+the+Byte+Order+Mark+%28BOM%29.+The+use+of+the+header%2Fsignature+is+usually...&amp;tags=c%23%2Cencoding%2Cutf8%2Cxml%2Cblog" type="text/html" />
	</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: baleinoid.com @ 2012-05-22 06:53:06 -->
