Skip to content

dns-check/simpleidn

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This gem allows easy conversion from punycode ACE strings to unicode UTF-8 strings and visa versa.

The implementation is heavily based on the RFC3492 C example implementation but simplified since it does not preserve case.

This gem works with Ruby 1.8.7, 1.9.2, 1.9.3, 2.0, 2.1, 2.2.

[sudo] gem install simpleidn

sudo is optional depending on your setup.

In your Ruby script you can now.

require 'rubygems'
require 'simpleidn'

SimpleIDN.to_unicode("xn--mllerriis-l8a.com")
=> "møllerriis.com"

SimpleIDN.to_ascii(“møllerriis.com”)

=> "xn--mllerriis-l8a.com"

In order to run the test suite you must have rspec installed.

The test suite has been copied from the IDN gem and uses examples from JOSEFSSON test vectors, taken from DRAFT-JOSEFSSON-IDN-TEST-VECTORS-00: www.gnu.org/software/libidn/draft-josefsson-idn-test-vectors.html

None at the moment, but please report any issues!

About

SimpleIDN ruby gem

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%