The IDN Library to use by the Ruby-FFI.
Add this line to your application's Gemfile:
gem 'idna'
And then execute:
$ bundle
Or install it yourself as:
$ gem install idna
- Attach function to
idna_to_ascii_8z
:
Idna.to_ascii('あいうえお') #xn--l8jegik
- Attach function to
idna_to_unicode_8z8z
:
Idna.to_unicode('xn--l8jegik') #あいうえお
- Custome libidn name:
Idna.configure do |config|
config.ffi_lib = 'idn.so.11'
end
Idna.reload!
$ bundle exec rspec
- MIT