Encoding problem

i'm new to ruby, and having got the basics by now i decided to try and
write a program that fetches RSS feeds and mashes them up into a
burroughs-style cut-up.

i first tested the feedtools gem.

code:

require 'rubygems'
require 'feed_tools'

feed = FeedTools::Feed.open('http://www.slashdot.org/index.rss')

puts feed.title
puts feed.link
puts feed.description

for item in feed.items
   puts item.title
   puts item.link
   puts item.content
end

then:

tryl ~/ruby tests $ ruby feeds.rb
<internal:lib/rubygems/custom_require>:29:in `require':
/usr/lib/ruby/gems/1.9.1/gems/feedtools-0.2.29/lib/feed_tools/helpers/uri_helper.rb:43:
invalid multibyte char (US-ASCII) (SyntaxError)
/usr/lib/ruby/gems/1.9.1/gems/feedtools-0.2.29/lib/feed_tools/helpers/uri_helper.rb:43:
invalid multibyte char (US-ASCII)
/usr/lib/ruby/gems/1.9.1/gems/feedtools-0.2.29/lib/feed_tools/helpers/uri_helper.rb:43:
syntax error, unexpected $end, expecting ')'
          if IDN::Idna.toASCII('http://www.詹姆斯.com/') ==

etc.

i tried adding "# encoding: utf-8" in the beginning, i made sure the
file is saved utf-8 encoded...

same.

any ideas?

···

--
Posted via http://www.ruby-forum.com/.

See here:

http://rubyforge.org/tracker/index.php?func=detail&aid=27804&group_id=775&atid=3061

···

--
Posted via http://www.ruby-forum.com/.