RubyIdn
Wrapped idn command for Ruby.
Requirements
Installation
Add this line to your application's Gemfile:
gem 'ruby-idn'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ruby-idn
Usage
unicode to ascii
require 'ruby_idn'
RubyIdn.to_ascii("ふー.com")
#=> "xn--19j6o.com"
ascii to unicode
require 'ruby_idn'
RubyIdn.to_unicode("xn--19j6o.com")
#=> "ふー.com"
License
The gem is available as open source under the terms of the MIT License.