<?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>Dave Rowe's Blog &#187; utf-8</title>
	<atom:link href="http://blog.roweware.com/tag/utf-8/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.roweware.com</link>
	<description>Ramblings about things I think I know...</description>
	<lastBuildDate>Wed, 14 Jul 2010 17:45:52 +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>SQL Server Export Encoding</title>
		<link>http://blog.roweware.com/2010/03/03/sql-server-export-encoding/</link>
		<comments>http://blog.roweware.com/2010/03/03/sql-server-export-encoding/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 19:32:29 +0000</pubDate>
		<dc:creator>Dave Rowe</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[dos2unix]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[unicode]]></category>
		<category><![CDATA[utf-16]]></category>
		<category><![CDATA[utf-8]]></category>

		<guid isPermaLink="false">http://blog.roweware.com/?p=195</guid>
		<description><![CDATA[If you ask someone for an export of data, and you know the data is coming from SQL Server, be sure to clarify what encoding you&#8217;d like the export in (if they can configure it) &#8211; I spent a bit of time trying to figure out why I couldn&#8217;t reliably read a file, and by [...]]]></description>
			<content:encoded><![CDATA[<p>If you ask someone for an export of data, and you know the data is coming from <a href="http://www.microsoft.com/sqlserver/">SQL Server</a>, be sure to clarify what encoding you&#8217;d like the export in (if they can configure it) &#8211; I spent a bit of time trying to figure out why I couldn&#8217;t reliably read a file, and by using a hexeditor, I found the leading bytes were the culprit.  Comparing to a listing on <a href="http://en.wikipedia.org/wiki/Byte_order_mark#Representations_of_byte_order_marks_by_encoding">Wikipedia</a>, I found the file was in UTF-16, when I&#8217;m expecting simple UTF-8 or ASCII.  Easy solution though if you&#8217;re on a *nix machine:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p195code2'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1952"><td class="code" id="p195code2"><pre class="bash" style="font-family:monospace;">iconv <span style="color: #660033;">-f</span> UTF-<span style="color: #000000;">16</span> <span style="color: #660033;">-t</span> UTF-<span style="color: #000000;">8</span> input_file <span style="color: #000000; font-weight: bold;">&gt;</span> output_file</pre></td></tr></table></div>

<p>And you&#8217;re done!  Easy as pie&#8230;when you know what the problem is.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.roweware.com/2010/03/03/sql-server-export-encoding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
