<?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>NiceCabbage Blog &#187; xml</title>
	<atom:link href="http://www.nicecabbage.com/tag/xml/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nicecabbage.com</link>
	<description>Life, Design, Web Application</description>
	<lastBuildDate>Mon, 07 Jun 2010 02:03:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>REXML Error on Ruby1.9</title>
		<link>http://www.nicecabbage.com/2009/06/rexml-error-on-ruby19/</link>
		<comments>http://www.nicecabbage.com/2009/06/rexml-error-on-ruby19/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 13:28:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[TechTips]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.nicecabbage.com/?p=6</guid>
		<description><![CDATA[Symptom
I encountered an REXML Error of

Last 80 unconsumed characters

when parsing utf-8 xml strings using REXML on Ruby1.9.1.

Solution
try check encoding

puts xmlstring.encoding #=&#38;gt; 'US-ASCII' in my case

If the return value is not &#8220;utf-8&#8243;, you can change the encoding as below.

xmlstring.force_encoding&#40;&#34;utf-8&#34;&#41;

By this change, REXML will parse the input with the correct encodings.
]]></description>
			<content:encoded><![CDATA[<h3>Symptom</h3>
<p>I encountered an REXML Error of</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Last 80 unconsumed characters</pre></div></div>

<p>when parsing utf-8 xml strings using REXML on Ruby1.9.1.</p>
<h3></h3>
<h3>Solution</h3>
<p>try check encoding</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">puts</span> xmlstring.<span style="color:#9900CC;">encoding</span> <span style="color:#008000; font-style:italic;">#=&amp;gt; 'US-ASCII' in my case</span></pre></div></div>

<p>If the return value is not &#8220;utf-8&#8243;, you can change the encoding as below.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">xmlstring.<span style="color:#9900CC;">force_encoding</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;utf-8&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>By this change, REXML will parse the input with the correct encodings.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nicecabbage.com/2009/06/rexml-error-on-ruby19/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
