<?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>doodle dabbles &#187; unicode</title>
	<atom:link href="http://ashish.tonse.com/tag/unicode/feed/" rel="self" type="application/rss+xml" />
	<link>http://ashish.tonse.com</link>
	<description>a little nerdery for everyone</description>
	<lastBuildDate>Thu, 17 Sep 2009 21:35:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Firefox Illegal Character JS Error</title>
		<link>http://ashish.tonse.com/2009/01/firefox-illegal-character-js-error/</link>
		<comments>http://ashish.tonse.com/2009/01/firefox-illegal-character-js-error/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 13:33:24 +0000</pubDate>
		<dc:creator>Ashish</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[firebug]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[unicode]]></category>
		<category><![CDATA[utf8]]></category>

		<guid isPermaLink="false">http://ashish.tonse.com/?p=48</guid>
		<description><![CDATA[I encountered the following error in FireBug (FireFox) on jQuery&#8217;s ui.core.js that halts execution of the rest of my scripts:
illegal character 
The last time I encountered this problem, I renamed the file a few times and that fixed it. Yes, that makes no sense but as long as it was fixed, I just went about [...]]]></description>
			<content:encoded><![CDATA[<p>I encountered the following error in FireBug (FireFox) on jQuery&#8217;s ui.core.js that halts execution of the rest of my scripts:</p>
<p><code>illegal character </code></p>
<div id="attachment_80" class="wp-caption alignnone" style="width: 368px"><img class="size-full wp-image-80" title="illegal-character" src="http://ashish.tonse.com/wp-content/uploads/2009/01/illegal-character.png" alt="Illegal Character error in Firebug" width="358" height="93" /><p class="wp-caption-text">Illegal Character error in Firebug</p></div>
<p>The last time I encountered this problem, I renamed the file a few times and that fixed it. Yes, that makes no sense but as long as it was fixed, I just went about my merry self until it happened again today, and no amount of file renaming would fix it. So I did a little bit of investigation to figure out exactly why this happened.</p>
<p><span id="more-48"></span></p>
<p>First, I found this problem only happening in Firefox, and not Chrome, or IE.</p>
<p>When accessing the file directly in the browser, the first 3 chars were:</p>
<p><code>﻿<br />
/*<br />
*<br />
*<br />
*<br />
*<br />
*/</code></p>
<p><code> </code></p>
<p><code>(function($) {<br />
</code></p>
<p>cURL returned the same result, narrowing it down to either the server adding that character, or the file containing it. Since the server is JBoss, it&#8217;s most likely the file.</p>
<p>Opening the file in Binary mode in Textpad, I found that the first 3 bytes had the hex value: <code>EF BB BF</code></p>
<p>This has to be a standard hex header for a certain file format (probably unicode related?) So I googled for that hex value. The first result was a <a title="wikipedia entry" href="http://en.wikipedia.org/wiki/Byte-order_mark" target="_blank">wikipedia entry</a> for Byte-order mark. This made total sense already. The Byte-order mark specifies the byte order (<a href="http://en.wikipedia.org/wiki/Endianness">endianness</a>) of the file that follows, with relation to unicode-related encodings. It turns out that <code>EF BB BF</code> is the Byte-order mark to denote UTF-8, but at the same time, it is completely unnecessary as UTF-8 has no byte-order issues by design.</p>
<p>So I had to get notepad++ to remove the first 3 bytes of that file, by choosing the option for &#8220;Encode in UTF-8 without BOM&#8221; in the Format Menu.</p>
<p>This fixed the issue! I hope this helps others that encounter this completely obscure looking error.</p>
]]></content:encoded>
			<wfw:commentRss>http://ashish.tonse.com/2009/01/firefox-illegal-character-js-error/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
