<?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>Benjamin Sherman &#187; corrupt_file</title>
	<atom:link href="http://holyarmy.org/tag/corrupt_file/feed/" rel="self" type="application/rss+xml" />
	<link>http://holyarmy.org</link>
	<description>I have to have a tagline?</description>
	<lastBuildDate>Wed, 02 Jun 2010 06:06:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Fixing Binary File Corruption from Ant Copies</title>
		<link>http://holyarmy.org/2007/10/fixing-binary-file-corruption-from-ant-copies/</link>
		<comments>http://holyarmy.org/2007/10/fixing-binary-file-corruption-from-ant-copies/#comments</comments>
		<pubDate>Thu, 01 Nov 2007 02:44:09 +0000</pubDate>
		<dc:creator>benjamin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[binary]]></category>
		<category><![CDATA[corrupt_file]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://sherman.bz/2007/10/31/fixing-binary-file-corruption-from-ant-copies/</guid>
		<description><![CDATA[So there I was, poking around in some java / j2ee code, trying to learn how it all works. I did some testing on a Linux server and realized, something is broken. It seemed something was corrupting ALL the Jar files in WEB-INF/lib/. A co-worker guessed that the token filtering Ant was doing might be [...]]]></description>
			<content:encoded><![CDATA[<p>So there I was, poking around in some java / j2ee code, trying to learn how it all works. I did some testing on a Linux server and realized, something is broken. It seemed something was corrupting ALL the Jar files in WEB-INF/lib/.</p>
<p>A co-worker guessed that the token filtering Ant was doing might be the culprit. He was right. It seems Ant has issues with detecting whether files are binary or not, given that it uses a Reader class which runs the files through a character decoder. This is specifically a problem on Unix systems since they commonly use UTF8 character set, and in that case Ant hasn&#8217;t a clue if its looking at UTF8 text or binary data.</p>
<p>So, I used a trick suggested in the Ant docs:</p>
<blockquote><p><em>Another trick is to change the LANG environment variable from something like &#8220;us.utf8&#8243; to &#8220;us&#8221;.</em></p></blockquote>
<p>On the Linux box, this meant we had a default character set of <em>en_US.UTF-8</em> and it needed to be <em>en_US</em>. In this case we already had a bash shell script that runs ant, so adding a line <em><strong>export LANG=en_US</strong></em> to that script before Ant ran solved the problem.</p>
<p>Reference:<br />
<a href="http://ant.apache.org/manual/CoreTasks/copy.html#encoding" target="_blank">http://ant.apache.org/manual/CoreTasks/copy.html#encoding</a></p>
]]></content:encoded>
			<wfw:commentRss>http://holyarmy.org/2007/10/fixing-binary-file-corruption-from-ant-copies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

