Sporkmonger

purveyor of fabulously ambiguous eating utensils

Internationalized Domain Names

Posted by sporkmonger
Written February 27th, 2006

I just checked in optional support for internationalized domain names in FeedTools. FeedTools can now at least open all of his test feeds, and it seems to handle any of the links that only involve an internationalized domain name, so it reads the self link and the alternate link, but it fails to understand the enclosure, and it doesn’t yet provide the option to normalize the urls in the content.

1
2
3
4
5
6
7
8

require 'feed_tools'
feed = FeedTools::Feed.open(
  'http://www.詹姆斯.com/atomtests/iri/everything.atom')
feed.href
#=> "http://www.xn--8ws00zhy3a.com/atomtests/iri/everything.atom"
feed.link
#=> "http://www.xn--8ws00zhy3a.com/atomtests/iri/"

In order for it to work, you need libidn installed as well as the idn gem for Ruby.

Tags: ,

Leave a Response

NOTE: I'm afraid Javascript needs to be on in order to comment.

Comments should be formatted using Textile.

Ruby code should be enclosed within a <macro:code lang="ruby"> element. Other languages are supported. For output you can simply omit the lang attribute.