This is a port of the old idn gem to Ruby 1.9 compatibility.